ping

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Message

	IsOnline  bool      `json:"is_online"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	PingedAt  time.Time `json:"pinged_at"`
}

type Message

type Message struct {
	ID        string    `json:"id,omitempty"`
	Name      string    `json:"name,omitempty"`
	Type      string    `json:"type,omitempty"`
	Revision  string    `json:"revision,omitempty"`
	Branch    string    `json:"branch,omitempty"`
	BuildTime time.Time `json:"build_time,omitempty"`

	IP string `json:"ip,omitempty"`
}

Message stores information about device

type NotifyDeviceStateChanged

type NotifyDeviceStateChanged func(d Device)

type Store

type Store interface {
	Ping(msg Message)
	Subscribe(fn NotifyDeviceStateChanged)
	GetDevices() []Device
	GetDevice(id string) (Device, bool)
	UpsertDevice(d Device)
	PingDevice(id string)
	MarkOffline(id string)
}

func New

func New(sentry *sentry.Client) Store

Jump to

Keyboard shortcuts

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