Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event uint
Event an event identifier.
const ( // Event called when a node connects EventConnect Event = iota // Event called when a node disconnects cleanly EventDisconnect // Event called when a node shuts down cleanly EventShutdown // Event called when a node is lost due to connection loss/crash EventLoss // Event called when an update is available EventAvailable )
type EventMessage ¶
type EventMessage struct {
// Event the event const that this corresponds to
Event Event `json:"event"`
// Any data that belongs to the event.
Data []string `json:"data"`
}
EventMessage a message containing an event and it's data.
type Message ¶
type Message struct {
// ID an ID to only forward once
ID uuid.UUID
// SourceID the ID of the sender so we can traceback.
SourceID string
// Type the type of message this is.
Type MessageType
// Data the JSON data
Data []byte
// Message the message we contain
Message interface{}
// Already marshaled json
Cache []byte
}
Message an abstract, the message to be sent/received/forwarded.
func (Message) MarshalJSON ¶
func (*Message) UnmarshalJSON ¶
type MessageType ¶
type MessageType uint
The message type
const ( TypeMessageUnknown MessageType = iota TypeMessageEvent TypeMessageRebootEstablish )
type RebootEstablishMessage ¶
type RebootEstablishMessage struct {
// RebootAfter I will reboot after this time after the previous server has come up.
RebootAfter time.Duration `json:"reboot_after"`
// DeadAfter Consider me dead after this duration of not coming back up
DeadAfter time.Duration `json:"dead_after"`
}
RebootEstablishMessage a message to establish this instances reboot timings.
Click to show internal directories.
Click to hide internal directories.