Documentation
¶
Index ¶
- func ToPBAgentMessage(msg *AgentMessage) *transportpb.AgentMessage
- func ToPBCommand(v *Command) *transportpb.Command
- func ToPBCommandResult(v *CommandResult) *transportpb.CommandResult
- func ToPBMetricSample(v MetricSample) *transportpb.MetricSample
- func ToPBRegistration(v *Registration) *transportpb.Registration
- func ToPBServerMessage(msg *ServerMessage) *transportpb.ServerMessage
- type AgentMessage
- type BasicInfo
- type Command
- type CommandResult
- type CommandType
- type Heartbeat
- type MessageKind
- type MetricCategory
- type MetricSample
- type MetricsBatch
- type NodeSnapshot
- type Registration
- type ServerAck
- type ServerMessage
- type TimedSample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToPBAgentMessage ¶
func ToPBAgentMessage(msg *AgentMessage) *transportpb.AgentMessage
func ToPBCommand ¶
func ToPBCommand(v *Command) *transportpb.Command
func ToPBCommandResult ¶
func ToPBCommandResult(v *CommandResult) *transportpb.CommandResult
func ToPBMetricSample ¶
func ToPBMetricSample(v MetricSample) *transportpb.MetricSample
func ToPBRegistration ¶
func ToPBRegistration(v *Registration) *transportpb.Registration
func ToPBServerMessage ¶
func ToPBServerMessage(msg *ServerMessage) *transportpb.ServerMessage
Types ¶
type AgentMessage ¶
type AgentMessage struct {
Kind MessageKind
Registration *Registration
Metrics *MetricsBatch
Result *CommandResult
Heartbeat *Heartbeat
}
func FromPBAgentMessage ¶
func FromPBAgentMessage(msg *transportpb.AgentMessage) *AgentMessage
type Command ¶
type Command struct {
ID string
NodeID string
Type CommandType
IssuedAt int64
Payload any
}
func FromPBCommand ¶
func FromPBCommand(v *transportpb.Command) *Command
type CommandResult ¶
type CommandResult struct {
CommandID string
NodeID string
Type CommandType
Success bool
Error string
FinishedAt int64
}
func FromPBCommandResult ¶
func FromPBCommandResult(v *transportpb.CommandResult) *CommandResult
type CommandType ¶
type CommandType string
type Heartbeat ¶
func NewHeartbeat ¶
type MessageKind ¶
type MessageKind string
const ( MessageKindRegister MessageKind = "register" MessageKindMetrics MessageKind = "metrics" MessageKindCommandResult MessageKind = "command_result" MessageKindHeartbeat MessageKind = "heartbeat" MessageKindCommand MessageKind = "command" MessageKindAck MessageKind = "ack" )
type MetricCategory ¶
type MetricCategory string
type MetricSample ¶
type MetricSample struct {
Category MetricCategory
At int64
Payload any
}
func FromPBMetricSample ¶
func FromPBMetricSample(v *transportpb.MetricSample) MetricSample
type MetricsBatch ¶
type MetricsBatch struct {
NodeID string
Samples []MetricSample
SentAt int64
}
type NodeSnapshot ¶
type NodeSnapshot struct {
NodeID string
Connected bool
LastSeen int64
SourceIP string
Registration *Registration
Latest map[string]TimedSample
}
type Registration ¶
func FromPBRegistration ¶
func FromPBRegistration(v *transportpb.Registration) *Registration
type ServerMessage ¶
type ServerMessage struct {
Kind MessageKind
Command *Command
Ack *ServerAck
}
func FromPBServerMessage ¶
func FromPBServerMessage(msg *transportpb.ServerMessage) *ServerMessage
type TimedSample ¶
type TimedSample struct {
NodeID string
Category MetricCategory
At int64
Payload any
}
Click to show internal directories.
Click to hide internal directories.