示例#1
0
func main() {

	cebadapter.Attach("DuoAuth", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			term.Write("Store Configuration Successfully Loaded...", term.Information)

			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					term.Write("Store Configuration Successfully Updated...", term.Information)
				})
			})
		})
		term.Write("Successfully registered in CEB", term.Information)
	})

	authlib.SetupConfig()
	term.GetConfig()

	//go Bingo()
	stat.Start()
	go webServer()
	go runRestFul()

	term.SplashScreen("splash.art")
	term.Write("================================================================", term.Splash)
	term.Write("|     Admintration Console running on  :9000                   |", term.Splash)
	term.Write("|     https RestFul Service running on :3048                   |", term.Splash)
	term.Write("|     Duo v6 Auth Service 6.0                                  |", term.Splash)
	term.Write("================================================================", term.Splash)
	term.StartCommandLine()

}
示例#2
0
func initialize() {
	cebadapter.Attach("ProcessDispatcher", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			fmt.Println("Store Configuration Successfully Loaded...")

			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					fmt.Println("Store Configuration Successfully Updated...")
				})
			})
		})
		fmt.Println("Successfully registered in CEB")
	})

	httpServer := endpoints.HTTPService{}
	httpServer.Start()
}
示例#3
0
func (s *Scheduler) Start() {
	cebadapter.Attach("ProcessScheduler", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			fmt.Println("Store Configuration Successfully Loaded...")

			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					fmt.Println("Store Configuration Successfully Updated...")
				})
			})
		})
		fmt.Println("Successfully registered in CEB")
	})

	downloader := core.Downloader{}
	term.Write("Starting Serviec Console Scheduler...", term.Debug)
	downloader.Start()
}
示例#4
0
func main() {
	cebadapter.Attach("Registration", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			fmt.Println("Store Configuration Successfully Loaded...")

			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					fmt.Println("Store Configuration Successfully Updated...")
				})
			})
		})
		fmt.Println("Successfully registered in CEB")
	})

	gorest.RegisterService(new(RegistationService)) //Register our service
	http.Handle("/", gorest.Handle())
	argument := os.Args[1]
	fmt.Println(argument)
	http.ListenAndServe(":"+argument, nil)
}
示例#5
0
func main() {
	Draw()

	cebadapter.Attach("ServiceConsole", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			fmt.Println("Store Configuration Successfully Loaded...")

			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					fmt.Println("Store Configuration Successfully Updated...")
				})
			})
		})
		fmt.Println("Successfully registered in CEB")
	})

	x := make(chan bool)
	x <- true

}
示例#6
0
func Send(securityToken string, notifyMethod string, parameters map[string]interface{}) messaging.NotifierResponse {
	//Creating Request to send
	var Request *messaging.NotifierRequest
	//Loading CEB
	forever := make(chan bool)
	cebadapter.Attach("DuoNotifier", func(s bool) {
		cebadapter.GetLatestGlobalConfig("DuoNotifier", func(data []interface{}) {
			Request.Log("DuoNotifier Configuration Successfully Loaded...")
			if data != nil {
				forever <- false
			}
		})
		Request.Log("Successfully registered in CEB")
	})

	<-forever

	//Load configurations from CEB to request
	var response messaging.NotifierResponse
	response = initialize(Request, securityToken, notifyMethod, parameters)
	return response

}
示例#7
0
func initialize() {

	cebadapter.Attach("ObjectStore", func(s bool) {
		cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
			fmt.Println("Store Configuration Successfully Loaded...")
			fmt.Println(data)
			agent := cebadapter.GetAgent()

			agent.Client.OnEvent("globalConfigChanged.StoreConfig", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
				cebadapter.GetLatestGlobalConfig("StoreConfig", func(data []interface{}) {
					fmt.Println("Store Configuration Successfully Updated...")
				})
			})
		})

		// cebadapter.GetLatestGlobalConfig("AutoIncrementMetaStore", func(data []interface{}) {
		// 	fmt.Println("AutoIncrementMetaStore Configuration Successfully Loaded...")
		// 	agent := cebadapter.GetAgent()
		// 	fmt.Println(data)
		// 	agent.Client.OnEvent("globalConfigChanged.AutoIncrementMetaStore", func(from string, name string, data map[string]interface{}, resources map[string]interface{}) {
		// 		cebadapter.GetLatestGlobalConfig("AutoIncrementMetaStore", func(data []interface{}) {
		// 			fmt.Println("AutoIncrementMetaStore Configuration Successfully Updated...")
		// 		})
		// 	})
		// })
		fmt.Println("Successfully registered in CEB")
	})

	httpServer := endpoints.HTTPService{}
	go httpServer.Start()

	bulkService := endpoints.BulkTransferService{}
	go bulkService.Start()

	forever := make(chan bool)
	<-forever
}