Documentation
¶
Index ¶
- type Commander
- func (c *Commander) Error(ctx context.Context, to string, errorCore int)
- func (c *Commander) Information(ctx context.Context, to string, payload any)
- func (c *Commander) Name() string
- func (c *Commander) Shutdown(ctx context.Context, to string)
- func (c *Commander) StartUp(ctx context.Context, to string, payload order.OrderStartUpPayload)
- type Config
- type Database
- func (d *Database) CreateModuleDB(ctx context.Context, mod *Module) error
- func (d *Database) DeleteModuleDB(ctx context.Context, mod *Module) error
- func (d *Database) FindModulesDB(ctx context.Context) ([]*Module, error)
- func (d *Database) SaveModuleDB(ctx context.Context, mod *Module) error
- func (d *Database) SaveModulesDB(ctx context.Context, modules []*Module) error
- type Handler
- func (h *Handler) CheckHeartbeats()
- func (h *Handler) CreateModule() (*Module, int, error)
- func (h *Handler) DeleteModule(mod *Module)
- func (h *Handler) GetModule(id string) (*Module, int)
- func (h *Handler) MainServiceWorker(ctx context.Context, data notification.Notification)
- func (h *Handler) NotificationInformation(ctx context.Context, data notification.Notification, ...)
- func (h *Handler) NotificationUpdate(ctx context.Context, data notification.Notification, ...)
- func (h *Handler) Start(ctx context.Context) error
- func (h *Handler) Stop()
- type Module
- type StringArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
func NewCommander ¶
func NewCommander(hostname string, communication *pubsub.Communication) *Commander
func (*Commander) Information ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func (*Database) CreateModuleDB ¶
func (*Database) DeleteModuleDB ¶
func (*Database) FindModulesDB ¶
func (*Database) SaveModuleDB ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CheckHeartbeats ¶
func (h *Handler) CheckHeartbeats()
check if any module is not responsive and delete it, then send shutdown command to it
func (*Handler) DeleteModule ¶
func (*Handler) MainServiceWorker ¶
func (h *Handler) MainServiceWorker(ctx context.Context, data notification.Notification)
func (*Handler) NotificationInformation ¶
func (h *Handler) NotificationInformation(ctx context.Context, data notification.Notification, payload inquiry.InquiryInformationPayload)
func (*Handler) NotificationUpdate ¶
func (h *Handler) NotificationUpdate(ctx context.Context, data notification.Notification, payload notification.NotificationUpdatePayload)
type Module ¶
type Module struct {
gorm.Model
UUID string
Name string
Changes StringArray
CreateAt time.Time // time it was created
StartUpDuration time.Duration // Duration to be ready
Heartbeat time.Duration // Duration between heartbeats
TimeLastUpdate time.Time // time it was last updated
Ready bool
SheduledForCleanUp bool
}
func (*Module) LifecycleOver ¶
type StringArray ¶
type StringArray []string
func (*StringArray) Scan ¶
func (s *StringArray) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.