package main import ( "github.com/globalsign/mgo" "github.com/jinzhu/gorm" ) type CoreInterface interface { Register() (string, error) UnRegister() error BeforeLoadPlugins() error LoadPlugins() error AfterLoadPlugins() error BeforeLoadConfiguration() error LoadConfiguration() error AfterLoadConfiguration() error // connection string parameter e.g. "localhost" ConnectMongoDB(string) (*mgo.Session, error) // connection string parameter ConnectGORM(string) (*gorm.DB, error) // ConnectNeo4j // ConnectArangoDB // ConnectCassandra // ConnectDGraph BeforeConnectToDatabases() error ConnectToDatabases() error AfterConnectToDatabases() error BeforeSetupLogger() error SetupLogger() error AfterSetupLogger() error BeforeSetupRoutes() error SetupRoutes() error AfterSetupRoutes() error BeforeRun() error Run() error AfterRun() error } type HandlerInterface interface { Register() (string, error) UnRegister() error BeforeProcessRequest() error ProcessRequest() error AfterProcessRequest() error BeforeLoadDataFromDatabase() error LoadDataFromDatabase() error AfterLoadDataFromDatabase() error BeforeSaveDataToDatabase() error SaveDataToDatabase() error AfterSaveDataToDatabase() error BeforeRenderOutput() error RenderOutput() error AfterRenderOutput() error }