Documentation
¶
Index ¶
- func GetCache() *bigcache.BigCache
- func GetRouter() *mux.Router
- func InitVersion()
- func LoadModules()
- func RegisterRoutes()
- func SendJSONResponse(w http.ResponseWriter, r EatherResponse)
- func Start(conf *Config)
- func StartCrons(cronList []Cron)
- type Base
- type Cmd
- type Config
- type Cron
- type CronList
- type Database
- type EatherResponse
- type EventCollection
- type Events
- type EventsInterface
- type FiresCollection
- type Module
- type ModuleVersion
- type Registry
- type RegistryInterface
- type Response
- type Routes
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitVersion ¶ added in v0.3.0
func InitVersion()
InitVersion - initialize version with automigration
func LoadModules ¶ added in v0.3.0
func LoadModules()
LoadModules will load all modules inside modulesDir directory
func SendJSONResponse ¶ added in v0.3.0
func SendJSONResponse(w http.ResponseWriter, r EatherResponse)
SendJSONResponse will set type to application/json and send to response
func Start ¶
func Start(conf *Config)
Start eather application initialize http server and load all modules
func StartCrons ¶ added in v0.3.0
func StartCrons(cronList []Cron)
StartCrons will start crons in background
Types ¶
type Base ¶ added in v0.3.0
type Base struct {
ID uuid.UUID `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
}
Base contains common columns for all tables.
type Config ¶ added in v0.3.0
type Config struct {
// contains filtered or unexported fields
}
Config structure of config for Eather
type EatherResponse ¶ added in v0.3.0
EatherResponse struct - customize response for routes
type EventCollection ¶ added in v0.3.0
type EventCollection map[string]event
EventCollection is definition of events collection
type Events ¶ added in v0.3.0
type Events struct {
Collection EventCollection
}
Events struct - collection of events
func (*Events) Emmit ¶ added in v0.3.0
Emmit the event from the collection data will be passed to the event func
func (*Events) GetCollection ¶ added in v0.3.0
func (r *Events) GetCollection() EventCollection
GetCollection will return collection of events
type EventsInterface ¶ added in v0.3.0
type EventsInterface interface {
Emmit(name string, data ...interface{})
Add(name string, f types.EventFunc, call string)
Remove(name string)
GetCollection() EventCollection
}
EventsInterface interface of events
func GetEvents ¶ added in v0.3.0
func GetEvents() EventsInterface
GetEvents - get collection of all registered events
type FiresCollection ¶ added in v0.3.0
FiresCollection is definition of fires collection
type Module ¶ added in v0.3.0
Module of type ModuleXML
func (Module) GetVersion ¶ added in v0.3.0
GetVersion - load version from database
func (Module) UpdateVersion ¶ added in v0.3.0
func (m Module) UpdateVersion()
UpdateVersion - set the new version of the module to the database
type ModuleVersion ¶ added in v0.3.0
ModuleVersion struct - structure of moduleVersion in database
type Registry ¶ added in v0.3.0
Registry struct - collection for registry
type RegistryInterface ¶ added in v0.3.0
type RegistryInterface interface {
Get(name string) types.Module
Add(object types.Module, name string)
Contains(name string) bool
Remove(name string)
}
RegistryInterface - interface for a registry
func GetRegistry ¶ added in v0.3.0
func GetRegistry() RegistryInterface
GetRegistry load registry collection
type Routes ¶ added in v0.3.0
type Routes struct {
Collection map[string]func(w http.ResponseWriter, r *http.Request) EatherResponse
}
Routes struct - collection of routes