From 560a16b6fe912250415406f1e9952e3f9f097350 Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Fri, 19 May 2017 11:24:19 +0900 Subject: [PATCH] initializer --- .idea/libraries/Go_SDK.xml | 10 ++++++++++ .idea/vcs.xml | 6 ++++++ initializer.go | 20 ++++++++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .idea/libraries/Go_SDK.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/libraries/Go_SDK.xml b/.idea/libraries/Go_SDK.xml new file mode 100644 index 0000000..c68ceae --- /dev/null +++ b/.idea/libraries/Go_SDK.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/initializer.go b/initializer.go index 4679644..811c98d 100644 --- a/initializer.go +++ b/initializer.go @@ -1,18 +1,18 @@ package initializer_go import ( - "sync" - cm "loafle.com/overflow/agent_api/config_manager" "google.golang.org/grpc" + cm "loafle.com/overflow/agent_api/config_manager" + "sync" ) var ( - once sync.Once + once sync.Once instance *Initializer ) type Initializer struct { - gconf *cm.GlobalConfig + gconf *cm.GlobalConfig } func Start(ch chan string, conf *cm.GlobalConfig) error { @@ -26,6 +26,15 @@ func Start(ch chan string, conf *cm.GlobalConfig) error { return nil } + +func Stop(res chan bool) { + + GetInstance().stop() + + res <- true +} + + func GetInstance() *Initializer { once.Do(func() { instance = &Initializer{} @@ -47,3 +56,6 @@ func (i *Initializer) getSecretKey() (string, error) { } +func (i *Initializer) stop() { + +} \ No newline at end of file