Documentation
¶
Index ¶
- type Application
- func (app *Application) CallHook(name string, payload interface{}) (bool, bool, error)
- func (app *Application) Done()
- func (app *Application) Init()
- func (app *Application) ListenToHook(name string, callback func(interface{}) (bool, error))
- func (app *Application) LoadPlugins(path string, modules *[]Module)
- func (app *Application) Ping() string
- func (app *Application) Run()
- func (app *Application) SysInit()
- func (app *Application) UseBasicAuth(contextName string) *BasicAuth
- type BasicAuth
- type Hook
- type HookCallback
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { DB *ecomdb.DBConnector Hooks map[string][]Hook SystemModules []Module UserModules []Module Router *gin.Engine URIHandler *urihandler.URIHandler }
Application - Struct that defines the application
func NewApplication ¶
func NewApplication() *Application
NewApplication - Create a new application object
func (*Application) CallHook ¶
func (app *Application) CallHook(name string, payload interface{}) (bool, bool, error)
CallHook - Call and handle hokks by the given name and execute them with the supplied payload
func (*Application) Init ¶
func (app *Application) Init()
Init - Here the system will initialize all its main components.
func (*Application) ListenToHook ¶
func (app *Application) ListenToHook(name string, callback func(interface{}) (bool, error))
ListenToHook - Register a hook listener by name and with its callback function
func (*Application) LoadPlugins ¶
func (app *Application) LoadPlugins(path string, modules *[]Module)
LoadPlugins - Load all plugins from the given path and add them to the supplied list of modules
func (*Application) Ping ¶
func (app *Application) Ping() string
Ping - A plain Ping/Pong to check if there still are life on Mars
func (*Application) Run ¶
func (app *Application) Run()
Run - This is the main part of the system. From here everything will be run.
func (*Application) SysInit ¶
func (app *Application) SysInit()
SysInit - This is a form of pre-init that will warm up the system, load all plugins and make some pre-initializations
func (*Application) UseBasicAuth ¶
func (app *Application) UseBasicAuth(contextName string) *BasicAuth
UseBasicAuth - Middleware registratio function for using basic authentication
type BasicAuth ¶
type BasicAuth struct { App *Application ContextName string }
func (*BasicAuth) Use ¶
func (basic *BasicAuth) Use() gin.HandlerFunc
type HookCallback ¶
HookCallback - type definition for a HookCallback
type Module ¶
type Module struct { SysInit func(app *Application) error Init func(app *Application) error Done func(app *Application) error Plugin *plugin.Plugin Filename string }
Module - Struct that defined a module (plugin)