heartbeat

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func (*Database) Open

func (d *Database) Open(dbConfig natsservice.MysqlConfig) error

type DatabaseConfig

type DatabaseConfig struct {
	DBHost string `ini:"dbhost,omitempty"`
	DBname string `ini:"dbname,omitempty"`
	DBuser string `ini:"dbuser,omitempty"`
	DBpass string `ini:"dbpass,omitempty"`
	DBPort int    `ini:"dbport,omitempty"`
}

type HeartbeatSaver

type HeartbeatSaver struct {
	natsservice.NatsService
	Config HeartbeatSaverConfig
	// contains filtered or unexported fields
}

HeartbeatSaver listens to com.plugis.heartbeat.Sent events and saves events in a database

func NewHeartbeatSaver added in v0.1.15

func NewHeartbeatSaver(config HeartbeatSaverConfig) *HeartbeatSaver

func (*HeartbeatSaver) Logger

func (svc *HeartbeatSaver) Logger() *logrus.Entry

func (*HeartbeatSaver) Run

func (svc *HeartbeatSaver) Run(ctx context.Context, params ...interface{}) error

type HeartbeatSaverConfig added in v1.1.34

type HeartbeatSaverConfig struct {
	MysqlConfig     natsservice.MysqlConfig
	OnHeartbeatSent OnHeartbeatSentCb
}

type HeartbeatSender

type HeartbeatSender struct {
	natsservice.NatsService
	Period       int
	RandomPeriod int
	Meta         map[string]interface{} // metas to send with heartbeat
	// contains filtered or unexported fields
}

func NewHeartbeatSender added in v1.1.18

func NewHeartbeatSender(period int, randomPeriod int, meta map[string]interface{}) *HeartbeatSender

func (*HeartbeatSender) AddMeta added in v1.1.40

func (svc *HeartbeatSender) AddMeta(key string, value interface{}, send bool) error

func (*HeartbeatSender) Logger

func (svc *HeartbeatSender) Logger() *logrus.Entry

func (*HeartbeatSender) RemoveMeta added in v1.1.40

func (svc *HeartbeatSender) RemoveMeta(key string, send bool) error

func (*HeartbeatSender) Run

func (svc *HeartbeatSender) Run(ctx context.Context, params ...interface{}) error

func (*HeartbeatSender) SendHeartbeatEvent

func (svc *HeartbeatSender) SendHeartbeatEvent(ctx context.Context) error

type HeartbeatWebInterface added in v0.1.14

type HeartbeatWebInterface struct {
	natsservice.NatsService
	// contains filtered or unexported fields
}

HeartbeatWebInterface exposes com.plugis.heartbeat.Sent events that are saved in the database

func NewHeartbeatWebInterface added in v0.1.15

func NewHeartbeatWebInterface(mysqlConfig natsservice.MysqlConfig) *HeartbeatWebInterface

func (*HeartbeatWebInterface) OnHeartbeatSent added in v1.1.34

func (svc *HeartbeatWebInterface) OnHeartbeatSent(heartbeatSent Sent)

OnHeartbeatSent is called each time a heartbeat event is received, must return as fast as possible

func (*HeartbeatWebInterface) Run added in v0.1.14

func (svc *HeartbeatWebInterface) Run(ctx context.Context, params ...interface{}) error

type OnHeartbeatSentCb added in v1.1.34

type OnHeartbeatSentCb func(sent Sent)

OnHeartbeatSentCb is called each time a heartbit send event is received

type Sent

type Sent struct {
	Hostname        string                 `json:"hostname"`
	Mac             string                 `json:"mac"`
	InternalIP      string                 `json:"ip"`
	Started         time.Time              `json:"started,omitempty"`
	Uptime          uint64                 `json:"uptime,omitempty"`
	NatsServiceName string                 `json:"nats-service,omitempty"`
	Os              string                 `json:"os,omitempty"`
	Arch            string                 `json:"arch,omitempty"`
	Meta            map[string]interface{} `json:"meta,omitempty"`
}

ce type : com.plugis.heartbeat.Sent

func NewSent

func NewSent(natsServiceName string, meta map[string]interface{}) (*Sent, error)

NewSent creates a new sent event

Jump to

Keyboard shortcuts

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