Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckData ¶
type CheckData struct { Unstructured map[string]interface{} CheckState *CheckState CheckStateDeleted *CheckStateDeleted }
CheckData describes state of a health stream it's an enumeration - only one of the fields should be filled Unstructured is intended to be used to pass through Python health state data see other type's description
func (*CheckData) JSONString ¶
JSONString encodes input into JSON while also encoding an error - for logging purpose
func (CheckData) MarshalJSON ¶
MarshalJSON ensures one of the cases is rendered
func (*CheckData) UnmarshalJSON ¶
UnmarshalJSON unmarshalls data from json
type CheckState ¶
type CheckState struct { CheckStateID string `json:"checkStateId"` // Identifier for the check state in the external system Message string `json:"message,omitempty"` // Message to display in StackState UI. Data will be interpreted as markdown allowing to have links to the external system check that generated the external check state. Health State `json:"health"` // StackState Health state TopologyElementIdentifier string `json:"topologyElementIdentifier"` // Used to bind the check state to a StackState topology element Name string `json:"name"` // Name of the external check state. }
CheckState describes state of a health stream see also: https://docs.stackstate.com/configure/health/send-health-data/repeat_snapshots https://docs.stackstate.com/configure/health/send-health-data/repeat_states https://docs.stackstate.com/configure/health/send-health-data/transactional_increments
type CheckStateDeleted ¶
type CheckStateDeleted struct { CheckStateID string `json:"checkStateId"` // Identifier for the check state in the external system Delete bool `json:"delete"` // should be true }
CheckStateDeleted describes signals StackState to delete a health stream
type Health ¶
type Health struct { StartSnapshot *StartSnapshotMetadata `json:"start_snapshot,omitempty"` StopSnapshot *StopSnapshotMetadata `json:"stop_snapshot,omitempty"` Stream Stream `json:"stream"` CheckStates []CheckData `json:"check_states"` }
Health is a batch of health synchronization data
type Payload ¶
Payload is a single payload for the batch of health synchronization data
func (Payload) JSONString ¶
JSONString returns a JSON string of the Payload
type StartSnapshotMetadata ¶
type StartSnapshotMetadata struct { RepeatIntervalS int `json:"repeat_interval_s"` ExpiryIntervalS int `json:"expiry_interval_s,omitempty"` }
StartSnapshotMetadata is a representation of 'start' for health synchronization
type StopSnapshotMetadata ¶
type StopSnapshotMetadata struct{}
StopSnapshotMetadata is a representation of 'stop' for health synchronization
type Stream ¶
Stream is a representation of a health stream for health synchronization
func (*Stream) UnmarshalJSON ¶
UnmarshalJSON decodes Stream in a way to be compatible with Python check (sub_stream -> SubStream) while keeping original encoding (SubStream `json:sub_stream_id`) compatible with intake API