Documentation ¶
Overview ¶
Package protocol contains declarations of the frames and JSON payload common to pollers, endpoints, etc
Index ¶
- Constants
- type CheckScheduleGet
- type Error
- type Frame
- type FrameMsg
- type FrameMsgCommon
- func (r *FrameMsgCommon) Encode() ([]byte, error)
- func (f *FrameMsgCommon) GetError() *Error
- func (f *FrameMsgCommon) GetId() uint64
- func (f *FrameMsgCommon) GetMethod() string
- func (f *FrameMsgCommon) GetRawParams() json.RawMessage
- func (f *FrameMsgCommon) GetRawResult() json.RawMessage
- func (f *FrameMsgCommon) GetSource() string
- func (f *FrameMsgCommon) GetTarget() string
- func (f *FrameMsgCommon) GetVersion() string
- func (f *FrameMsgCommon) SetFromFrameMsg(source *FrameMsg)
- func (f *FrameMsgCommon) SetId(msgSeqId *uint64)
- func (f *FrameMsgCommon) SetMethod(method string)
- func (f *FrameMsgCommon) SetRawId(id uint64)
- func (f *FrameMsgCommon) SetResponseFrameMsg(source *FrameMsg)
- func (f *FrameMsgCommon) SetSource(source string)
- func (f *FrameMsgCommon) SetTarget(target string)
- func (f *FrameMsgCommon) SetVersion(version string)
- type HandshakeParameters
- type HandshakeRequest
- type HandshakeResponse
- type HandshakeResult
- type HeartbeatParameters
- type HeartbeatRequest
- type HeartbeatResponse
- type HeartbeatResult
- type HostInfoResponse
- type MetricTVU
- type MetricWrap
- type MetricWrapper
- type MetricsPostRequest
- type MetricsPostRequestParams
- type PollerCommitParams
- type PollerCommitRequest
- type PollerCommitResponse
- type PollerCommitResult
- type PollerPrepareBlockParams
- type PollerPrepareBlockRequest
- type PollerPrepareEndParams
- type PollerPrepareEndRequest
- type PollerPrepareManifest
- type PollerPrepareRequest
- type PollerPrepareResponse
- type PollerPrepareResult
- type PollerPrepareStartParams
- type PollerPrepareStartRequest
Constants ¶
const ( PrepareActionStart = "start" PrepareActionRestart = "restart" PrepareActionContinue = "continue" PrepareDirectivePrepare = "prepare" PrepareDirectiveAbort = "abort" PrepareResultStatusPrepared = "prepared" PrepareResultStatusAborted = "aborted" PrepareResultStatusFailed = "failed" PrepareResultStatusIgnored = "ignored" PrepareResultStatusCommitted = "committed" )
const ( // MethodEmpty indicates this message is a response MethodEmpty = "" // MethodHandshakeHello is SENT TO ---> endpoint server MethodHandshakeHello = "handshake.hello" MethodCheckScheduleGet = "check_schedule.get" MethodPollerRegister = "poller.register" // MethodHeartbeatPost is SENT TO ---> endpoint server MethodHeartbeatPost = "heartbeat.post" MethodCheckMetricsPost = "check_metrics.post_multi" // MethodHostInfoGet is RECV FROM <--- endpoint server MethodHostInfoGet = "host_info.get" // MethodPollerPrepare is RECV FROM <--- endpoint server MethodPollerPrepare = "poller.prepare" // MethodPollerPrepareBlock is RECV FROM <--- endpoint server MethodPollerPrepareBlock = "poller.prepare.block" // MethodPollerPrepareEnd is RECV FROM <--- endpoint server MethodPollerPrepareEnd = "poller.prepare.end" // MethodPollerCommit is RECV FROM <--- endpoint server MethodPollerCommit = "poller.commit" )
const (
ProtocolVersion = "1"
)
const Version = "1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckScheduleGet ¶
func (CheckScheduleGet) Encode ¶
func (r CheckScheduleGet) Encode() ([]byte, error)
type Frame ¶
type Frame interface { Encode() ([]byte, error) GetVersion() string SetVersion(string) GetId() uint64 SetId(msgSeqId *uint64) SetRawId(uint64) GetTarget() string SetTarget(string) GetSource() string SetSource(string) GetMethod() string SetMethod(string) GetRawParams() json.RawMessage GetRawResult() json.RawMessage GetError() *Error SetFromFrameMsg(*FrameMsg) }
func NewCheckScheduleGet ¶
func NewCheckScheduleGet() Frame
func NewHandshakeRequest ¶
func NewPollerPrepareCommitResponse ¶
func NewPollerPrepareCommitResponse(source *FrameMsg, result PollerCommitResult) Frame
func NewPollerPrepareResponse ¶
func NewPollerPrepareResponse(source *FrameMsg, result PollerPrepareResult) Frame
type FrameMsg ¶
type FrameMsg struct { FrameMsgCommon RawParams json.RawMessage `json:"params,omitempty"` RawResult json.RawMessage `json:"result,omitempty"` }
FrameMsg implements Frame and conveys the raw params and result of a frame. This object is suitable for first-pass unmarshaling/decoding and for sending.
func NewFinishedFrame ¶
func NewFinishedFrame() *FrameMsg
func (*FrameMsg) GetRawParams ¶
func (f *FrameMsg) GetRawParams() json.RawMessage
func (*FrameMsg) GetRawResult ¶
func (f *FrameMsg) GetRawResult() json.RawMessage
func (*FrameMsg) IsFinished ¶
func (*FrameMsg) SetFromFrameMsg ¶
type FrameMsgCommon ¶
type FrameMsgCommon struct { Version string `json:"v"` Id uint64 `json:"id"` Target string `json:"target"` Source string `json:"source"` Method string `json:"method,omitempty"` Error *Error `json:"error,omitempty"` }
func (*FrameMsgCommon) Encode ¶
func (r *FrameMsgCommon) Encode() ([]byte, error)
func (*FrameMsgCommon) GetError ¶
func (f *FrameMsgCommon) GetError() *Error
func (*FrameMsgCommon) GetId ¶
func (f *FrameMsgCommon) GetId() uint64
func (*FrameMsgCommon) GetMethod ¶
func (f *FrameMsgCommon) GetMethod() string
func (*FrameMsgCommon) GetRawParams ¶
func (f *FrameMsgCommon) GetRawParams() json.RawMessage
func (*FrameMsgCommon) GetRawResult ¶
func (f *FrameMsgCommon) GetRawResult() json.RawMessage
func (*FrameMsgCommon) GetSource ¶
func (f *FrameMsgCommon) GetSource() string
func (*FrameMsgCommon) GetTarget ¶
func (f *FrameMsgCommon) GetTarget() string
func (*FrameMsgCommon) GetVersion ¶
func (f *FrameMsgCommon) GetVersion() string
func (*FrameMsgCommon) SetFromFrameMsg ¶
func (f *FrameMsgCommon) SetFromFrameMsg(source *FrameMsg)
func (*FrameMsgCommon) SetId ¶
func (f *FrameMsgCommon) SetId(msgSeqId *uint64)
func (*FrameMsgCommon) SetMethod ¶
func (f *FrameMsgCommon) SetMethod(method string)
func (*FrameMsgCommon) SetRawId ¶
func (f *FrameMsgCommon) SetRawId(id uint64)
func (*FrameMsgCommon) SetResponseFrameMsg ¶
func (f *FrameMsgCommon) SetResponseFrameMsg(source *FrameMsg)
func (*FrameMsgCommon) SetSource ¶
func (f *FrameMsgCommon) SetSource(source string)
func (*FrameMsgCommon) SetTarget ¶
func (f *FrameMsgCommon) SetTarget(target string)
func (*FrameMsgCommon) SetVersion ¶
func (f *FrameMsgCommon) SetVersion(version string)
type HandshakeParameters ¶
type HandshakeParameters struct { Token string `json:"token"` AgentId string `json:"agent_id"` AgentName string `json:"agent_name"` ProcessVersion string `json:"process_version"` BundleVersion string `json:"bundle_version"` ZoneIds []string `json:"zone_ids"` Features []map[string]string `json:"features"` }
type HandshakeRequest ¶
type HandshakeRequest struct { FrameMsg Params HandshakeParameters `json:"params"` }
func (HandshakeRequest) Encode ¶
func (r HandshakeRequest) Encode() ([]byte, error)
type HandshakeResponse ¶
type HandshakeResponse struct { FrameMsg Result HandshakeResult `json:"result"` }
func DecodeHandshakeResponse ¶
func DecodeHandshakeResponse(frame *FrameMsg) *HandshakeResponse
type HandshakeResult ¶
type HeartbeatParameters ¶
type HeartbeatParameters struct {
Timestamp int64 `json:"timestamp"`
}
type HeartbeatRequest ¶
type HeartbeatRequest struct { FrameMsg Params HeartbeatParameters `json:"params"` }
func NewHeartbeatRequest ¶
func NewHeartbeatRequest() *HeartbeatRequest
func (HeartbeatRequest) Encode ¶
func (r HeartbeatRequest) Encode() ([]byte, error)
type HeartbeatResponse ¶
type HeartbeatResponse struct { FrameMsg Result HeartbeatResult `json:"result"` }
func DecodeHeartbeatResponse ¶
func DecodeHeartbeatResponse(frame *FrameMsg) *HeartbeatResponse
type HeartbeatResult ¶
type HeartbeatResult struct {
Timestamp int64 `json:"timestamp"`
}
type HostInfoResponse ¶
type HostInfoResponse struct { FrameMsgCommon Result interface{} `json:"result"` }
func (*HostInfoResponse) Encode ¶
func (r *HostInfoResponse) Encode() ([]byte, error)
type MetricWrap ¶
type MetricWrapper ¶
type MetricWrapper []MetricWrap
type MetricsPostRequest ¶
type MetricsPostRequest struct { FrameMsg Params MetricsPostRequestParams `json:"params"` }
func (MetricsPostRequest) Encode ¶
func (r MetricsPostRequest) Encode() ([]byte, error)
type MetricsPostRequestParams ¶
type MetricsPostRequestParams struct { EntityId string `json:"entity_id"` CheckId string `json:"check_id"` CheckType string `json:"check_type"` Metrics []MetricWrap `json:"metrics"` MinCheckPeriod uint64 `json:"min_check_period"` State string `json:"state"` Status string `json:"status"` Timestamp int64 `json:"timestamp"` }
type PollerCommitParams ¶
PollerCommitParams is the params of a message with method=MethodPollerCommit
type PollerCommitRequest ¶
type PollerCommitRequest struct { FrameMsg Params PollerCommitParams `json:"params"` }
func DecodePollerCommitRequest ¶
func DecodePollerCommitRequest(frame *FrameMsg) *PollerCommitRequest
type PollerCommitResponse ¶
type PollerCommitResponse struct { FrameMsg Result PollerCommitResult `json:"result"` }
type PollerCommitResult ¶
type PollerPrepareBlockParams ¶
type PollerPrepareBlockParams struct { ZoneId string `json:"zone_id"` Version int `json:"version"` Block []*check.CheckIn `json:"block"` }
PollerPrepareBlockParams is the params of a message with method=MethodPollerPrepareBlock
type PollerPrepareBlockRequest ¶
type PollerPrepareBlockRequest struct { FrameMsg Params PollerPrepareBlockParams `json:"params"` }
func DecodePollerPrepareBlockRequest ¶
func DecodePollerPrepareBlockRequest(frame *FrameMsg) *PollerPrepareBlockRequest
func (*PollerPrepareBlockRequest) GetPreparationVersion ¶
func (req *PollerPrepareBlockRequest) GetPreparationVersion() int
func (*PollerPrepareBlockRequest) GetPreparationZoneId ¶
func (req *PollerPrepareBlockRequest) GetPreparationZoneId() string
type PollerPrepareEndParams ¶
type PollerPrepareEndParams struct { ZoneId string `json:"zone_id"` Version int `json:"version"` // Directive is one of PrepareDirective* constants Directive string `json:"directive"` }
PollerPrepareBlockParams is the params of a message with method=MethodPollerPrepareEnd
type PollerPrepareEndRequest ¶
type PollerPrepareEndRequest struct { FrameMsg Params PollerPrepareEndParams `json:"params"` }
func DecodePollerPrepareEndRequest ¶
func DecodePollerPrepareEndRequest(frame *FrameMsg) *PollerPrepareEndRequest
func (*PollerPrepareEndRequest) GetPreparationVersion ¶
func (req *PollerPrepareEndRequest) GetPreparationVersion() int
func (*PollerPrepareEndRequest) GetPreparationZoneId ¶
func (req *PollerPrepareEndRequest) GetPreparationZoneId() string
type PollerPrepareManifest ¶
type PollerPrepareRequest ¶
PollerPrepareRequest abstracts common info across the "poller.prepare.*" methods
type PollerPrepareResponse ¶
type PollerPrepareResponse struct { FrameMsg Result PollerPrepareResult `json:"result"` }
type PollerPrepareResult ¶
type PollerPrepareStartParams ¶
type PollerPrepareStartParams struct { ZoneId string `json:"zone_id"` Version int `json:"version"` Manifest []PollerPrepareManifest `json:"manifest"` }
PollerPrepareStartParams is the params of a message with method=MethodPollerPrepare
type PollerPrepareStartRequest ¶
type PollerPrepareStartRequest struct { FrameMsg Params PollerPrepareStartParams `json:"params"` }
func DecodePollerPrepareStartRequest ¶
func DecodePollerPrepareStartRequest(frame *FrameMsg) *PollerPrepareStartRequest
func (*PollerPrepareStartRequest) GetPreparationVersion ¶
func (req *PollerPrepareStartRequest) GetPreparationVersion() int
func (*PollerPrepareStartRequest) GetPreparationZoneId ¶
func (req *PollerPrepareStartRequest) GetPreparationZoneId() string
Directories ¶
Path | Synopsis |
---|---|
Package check provides the messaging structures specific to poller checks
|
Package check provides the messaging structures specific to poller checks |
Package hostinfo provides the messaging structures specific to host info queries
|
Package hostinfo provides the messaging structures specific to host info queries |
Package metric provides the messaging structures specific to metric reporting
|
Package metric provides the messaging structures specific to metric reporting |