diff --git a/events.go b/events.go new file mode 100644 index 0000000..4673b3e --- /dev/null +++ b/events.go @@ -0,0 +1,10 @@ +package main + +type Event struct { + Name string + Callback func(params ...interface{}) +} + +type EventHandler struct { + EventC <-chan *Event +} diff --git a/interfaces.go b/interfaces.go new file mode 100644 index 0000000..f155f6b --- /dev/null +++ b/interfaces.go @@ -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() +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..e721569 --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +func main() { + /* + Some way to load the core plugins and the handler plugins + */ +}