From 76256ff5dd43991543367b47085c4c9b21fd64df Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Sat, 20 May 2017 17:46:41 +0900 Subject: [PATCH] initializer --- .gitignore | 63 ++++++++++++++++++++++++++++++++++++++++ initialize/initialize.go | 3 ++ initialize/rpc_impl.go | 22 ++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 .gitignore create mode 100644 initialize/initialize.go create mode 100644 initialize/rpc_impl.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c09bd0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,63 @@ +# Created by .ignore support plugin (hsz.mobi) +### Go template +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 +.glide/ +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +.idea/central_api_gateway_initialize.iml +.idea/modules.xml diff --git a/initialize/initialize.go b/initialize/initialize.go new file mode 100644 index 0000000..18efc80 --- /dev/null +++ b/initialize/initialize.go @@ -0,0 +1,3 @@ +package initialize + +type Initializer struct {} \ No newline at end of file diff --git a/initialize/rpc_impl.go b/initialize/rpc_impl.go new file mode 100644 index 0000000..1b7c558 --- /dev/null +++ b/initialize/rpc_impl.go @@ -0,0 +1,22 @@ +package initialize + +import ( + pb "loafle.com/overflow/central_api_gateway/initialize" + "context" +) + + +type InitializeServerImpl struct { +} + +func (s *InitializeServerImpl) GetSecretKey(c context.Context, in *pb.AgentInfo) (*pb.InitResponse, error) { + + output := &pb.InitResponse{} + + //todo. generating secretkey + agentId := in.GetAgentId() + output.SecretKey = "overflow" + agentId + + return output, nil +} +