Documentation ¶
Index ¶
- type Database
- type DatabaseConfig
- type HeartbeatSaver
- type HeartbeatSaverConfig
- type HeartbeatSender
- func (svc *HeartbeatSender) AddMeta(key string, value interface{}, send bool) error
- func (svc *HeartbeatSender) Logger() *logrus.Entry
- func (svc *HeartbeatSender) RemoveMeta(key string, send bool) error
- func (svc *HeartbeatSender) Run(ctx context.Context, params ...interface{}) error
- func (svc *HeartbeatSender) SendHeartbeatEvent(ctx context.Context) error
- type HeartbeatWebInterface
- type OnHeartbeatSentCb
- type Sent
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 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
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
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
Click to show internal directories.
Click to hide internal directories.