Exemplo n.º 1
0
func execute(Request *messaging.NotifierRequest) messaging.NotifierResponse {
	var response messaging.NotifierResponse
	abstractRepository := repositories.Create(Request.NotifyMethod)
	Request.Log("Executing Abstract Repository : " + abstractRepository.GetNotifierName())
	response = abstractRepository.ExecuteNotifier(Request)
	return response
}
Exemplo n.º 2
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

}