Documentation
¶
Index ¶
- func GetCache() *bigcache.BigCache
- func GetRouter() *mux.Router
- func InitVersion()
- func LoadModules()
- func RegisterRoutes()
- func SendJSONResponse(w http.ResponseWriter, r EatherResponse)
- func StartCrons()
- type Base
- type Database
- type EatherResponse
- type EventCollection
- type Events
- type EventsInterface
- type FiresCollection
- type Module
- type ModuleVersion
- type Registry
- type RegistryInterface
- type Response
- type Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendJSONResponse ¶
func SendJSONResponse(w http.ResponseWriter, r EatherResponse)
SendJSONResponse will set type to application/json and send to response
Types ¶
type Base ¶
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 EatherResponse ¶
EatherResponse struct - customize response for routes
type EventCollection ¶
type EventCollection map[string]event
EventCollection is definition of events collection
type Events ¶
type Events struct {
Collection EventCollection
}
Events struct - collection of events
func (*Events) GetCollection ¶
func (r *Events) GetCollection() EventCollection
GetCollection will return collection of events
type EventsInterface ¶
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 ¶
func GetEvents() EventsInterface
GetEvents - get collection of all registered events
type FiresCollection ¶
FiresCollection is definition of fires collection
type Module ¶
Module of type ModuleXML
func (Module) GetVersion ¶
GetVersion - load version from database
func (Module) UpdateVersion ¶
func (m Module) UpdateVersion()
UpdateVersion - set the new version of the module to the database
type ModuleVersion ¶
ModuleVersion struct - structure of moduleVersion in database
type Registry ¶
Registry struct - collection for registry
type RegistryInterface ¶
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
type Routes ¶
type Routes struct {
Collection map[string]func(w http.ResponseWriter, r *http.Request) EatherResponse
}
Routes struct - collection of routes