open-nomad/nomad/structs/events.go
Chelsea Holland Komlo ae7a2d6eb1 code review feedback
2018-03-13 18:05:40 -07:00

38 lines
857 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package structs
// Subsystem denotes the subsystem where a node event took place.
type Subsystem string
const (
Drain Subsystem = "Drain"
Driver Subsystem = "Driver"
Heartbeat Subsystem = "Heartbeat"
Server Subsystem = "Server"
Cluster Subsystem = "Cluster"
)
// NodeEvent is a single unit representing a nodes state change
type NodeEvent struct {
Message string
Subsystem Subsystem
Details map[string]string
Timestamp int64
CreateIndex uint64
}
// EmitNodeEventRequest is a client request to update the node events source
// with a new client-side event
type EmitNodeEventRequest struct {
NodeID string
NodeEvent *NodeEvent
WriteRequest
}
// EmitNodeEventResponse is a server response to the client about the status of
// the node event source update.
type EmitNodeEventResponse struct {
Index uint64
WriteMeta
}