coreinterface, handlerinterface, event, eventhandler
This commit is contained in:
parent
6d2f5d05c7
commit
c9f3abd8b9
10
events.go
Normal file
10
events.go
Normal file
@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
type Event struct {
|
||||
Name string
|
||||
Callback func(params ...interface{})
|
||||
}
|
||||
|
||||
type EventHandler struct {
|
||||
EventC <-chan *Event
|
||||
}
|
45
interfaces.go
Normal file
45
interfaces.go
Normal file
@ -0,0 +1,45 @@
|
||||
package main
|
||||
|
||||
type CoreInterface interface {
|
||||
BeforeLoadPlugins()
|
||||
LoadPlugins()
|
||||
AfterLoadPlugins()
|
||||
|
||||
BeforeLoadConfiguration()
|
||||
LoadConfiguration()
|
||||
AfterLoadConfiguration()
|
||||
|
||||
BeforeConnectToDatabases()
|
||||
ConnectToDatabases()
|
||||
AfterConnectToDatabases()
|
||||
|
||||
BeforeSetupLogger()
|
||||
SetupLogger()
|
||||
AfterSetupLogger()
|
||||
|
||||
BeforeSetupRoutes()
|
||||
SetupRoutes()
|
||||
AfterSetupRoutes()
|
||||
|
||||
BeforeRun()
|
||||
Run()
|
||||
AfterRun()
|
||||
}
|
||||
|
||||
type HandlerInterface interface {
|
||||
BeforeProcessRequest()
|
||||
ProcessRequest()
|
||||
AfterProcessRequest()
|
||||
|
||||
BeforeLoadDataFromDatabase()
|
||||
LoadDataFromDatabase()
|
||||
AfterLoadDataFromDatabase()
|
||||
|
||||
BeforeSaveDataToDatabase()
|
||||
SaveDataToDatabase()
|
||||
AfterSaveDataToDatabase()
|
||||
|
||||
BeforeRenderOutput()
|
||||
RenderOutput()
|
||||
AfterRenderOutput()
|
||||
}
|
Loading…
Reference in New Issue
Block a user