module

package
v0.0.0-...-fb1eac7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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) Error

func (c *Commander) Error(ctx context.Context, to string, errorCore int)

func (*Commander) Information

func (c *Commander) Information(ctx context.Context, to string, payload any)

func (*Commander) Name

func (c *Commander) Name() string

func (*Commander) Shutdown

func (c *Commander) Shutdown(ctx context.Context, to string)

func (*Commander) StartUp

func (c *Commander) StartUp(ctx context.Context, to string, payload order.OrderStartUpPayload)

type Config

type Config struct {
	Name      string
	PubSubURL string
	RenderTo  string
	Database  string
}

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(connection string) (*Database, error)

func (*Database) CreateModuleDB

func (d *Database) CreateModuleDB(ctx context.Context, mod *Module) error

func (*Database) DeleteModuleDB

func (d *Database) DeleteModuleDB(ctx context.Context, mod *Module) error

func (*Database) FindModulesDB

func (d *Database) FindModulesDB(ctx context.Context) ([]*Module, error)

func (*Database) SaveModuleDB

func (d *Database) SaveModuleDB(ctx context.Context, mod *Module) error

func (*Database) SaveModulesDB

func (d *Database) SaveModulesDB(ctx context.Context, modules []*Module) error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(config *Config) (*Handler, error)

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) CreateModule

func (h *Handler) CreateModule() (*Module, int, error)

func (*Handler) DeleteModule

func (h *Handler) DeleteModule(mod *Module)

func (*Handler) GetModule

func (h *Handler) GetModule(id string) (*Module, int)

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)

func (*Handler) Start

func (h *Handler) Start(ctx context.Context) error

func (*Handler) Stop

func (h *Handler) Stop()

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 NewModule

func NewModule() (*Module, error)

func (*Module) LifecycleOver

func (m *Module) LifecycleOver() bool

type StringArray

type StringArray []string

func (*StringArray) Scan

func (s *StringArray) Scan(value interface{}) error

func (StringArray) Value

func (s StringArray) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL