Documentation ¶
Index ¶
- Variables
- func AddConfigDefaults(section string, values map[string]string)
- func GenerateBase64Token(n int) string
- func GetEnv(name string, default_value string) string
- type Application
- func (app *Application) Finalize()
- func (app *Application) Initialize()
- func (app *Application) LocateService(service_name string) ServiceI
- func (app *Application) RegisterService(svc ServiceI, service_name string)
- func (app *Application) Run()
- func (app *Application) Stop()
- func (app *Application) SubscribeSignal(signo syscall.Signal)
- func (app *Application) UnregisterService(svc ServiceI)
- type PubSub
- type PubSubMessage
- type Service
- type ServiceI
- type WebService
- func (svc *WebService) Debug(format string, v ...interface{})
- func (svc *WebService) Error(format string, v ...interface{})
- func (svc *WebService) Finalize()
- func (svc *WebService) Info(format string, v ...interface{})
- func (svc *WebService) Initialize(app *Application)
- func (svc *WebService) SetLevel(lvl int)
- func (svc *WebService) Warn(format string, v ...interface{})
- type ZookeeperService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // This is a global configuration (also accessible by `App.Config`) // It is a global because application can have only one configuration // and the config object has to exists before the application is initialized Config *ini.File )
Functions ¶
func AddConfigDefaults ¶
func GenerateBase64Token ¶
Generate random token using Base64 characters
Types ¶
type Application ¶
type Application struct { ReturnCode int Hostname string Config *ini.File PubSub PubSub // contains filtered or unexported fields }
func (*Application) Finalize ¶
func (app *Application) Finalize()
func (*Application) Initialize ¶
func (app *Application) Initialize()
func (*Application) LocateService ¶
func (app *Application) LocateService(service_name string) ServiceI
func (*Application) RegisterService ¶
func (app *Application) RegisterService(svc ServiceI, service_name string)
func (*Application) Run ¶
func (app *Application) Run()
func (*Application) SubscribeSignal ¶
func (app *Application) SubscribeSignal(signo syscall.Signal)
func (*Application) UnregisterService ¶
func (app *Application) UnregisterService(svc ServiceI)
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) Initialize ¶
func (ps *PubSub) Initialize()
func (*PubSub) Publish ¶
func (ps *PubSub) Publish(message PubSubMessage)
func (*PubSub) Subscribe ¶
func (ps *PubSub) Subscribe(message_type string, handler func(PubSubMessage))
type PubSubMessage ¶
type PubSubMessage struct { Name string I interface{} }
type Service ¶
type Service struct {
App *Application
}
func (*Service) Initialize ¶
func (svc *Service) Initialize(app *Application)
type WebService ¶
type WebService struct { Service Router *mux.Router Server *nbhttp.Server // contains filtered or unexported fields }
func (*WebService) Debug ¶
func (svc *WebService) Debug(format string, v ...interface{})
func (*WebService) Error ¶
func (svc *WebService) Error(format string, v ...interface{})
func (*WebService) Finalize ¶
func (svc *WebService) Finalize()
func (*WebService) Info ¶
func (svc *WebService) Info(format string, v ...interface{})
func (*WebService) Initialize ¶
func (svc *WebService) Initialize(app *Application)
func (*WebService) SetLevel ¶
func (svc *WebService) SetLevel(lvl int)
func (*WebService) Warn ¶
func (svc *WebService) Warn(format string, v ...interface{})
type ZookeeperService ¶
type ZookeeperService struct { Service Address []string BasePath string Connection *zk.Conn // contains filtered or unexported fields }
func (*ZookeeperService) Initialize ¶
func (svc *ZookeeperService) Initialize(app *Application)
func (*ZookeeperService) Printf ¶
func (svc *ZookeeperService) Printf(message string, v ...interface{})
Source Files ¶
Click to show internal directories.
Click to hide internal directories.