Documentation ¶
Index ¶
- Constants
- type AuthenticatedMessage
- type BaseChannelMessage
- type BaseControlMessage
- type BaseJSONChannelMessage
- type BaseJSONMessage
- type BaseMessage
- type BinaryMessageHeader
- type ChannelMessage
- type DataMessage
- type DataMessageHeader
- type DataPayload
- type ErrorContext
- type ErrorMessage
- type EventMessage
- type ExpiredTSIDMessage
- type FindLimitedResultSetContents
- type FindMatchedNoTimeseriesContents
- type GroupByMissingPropertyContents
- type InfoMessage
- type JSONMessage
- type JobDetectedLagContents
- type JobInitialMaxDelayContents
- type JobRunningResolutionContents
- type JobStartControlMessage
- type Message
- type MessageBlock
- type MetadataMessage
- type MetadataProperties
- type TimestampedMessage
- type ValType
Constants ¶
const ( StreamStartEvent = "STREAM_START" JobStartEvent = "JOB_START" JobProgressEvent = "JOB_PROGRESS" ChannelAbortEvent = "CHANNEL_ABORT" EndOfChannelEvent = "END_OF_CHANNEL" )
The event types used in the control-message messages. This are not used for "event" type messages.
const ( JobRunningResolution = "JOB_RUNNING_RESOLUTION" JobDetectedLag = "JOB_DETECTED_LAG" JobInitialMaxDelay = "JOB_INITIAL_MAX_DELAY" FindLimitedResultSet = "FIND_LIMITED_RESULT_SET" FindMatchedNoTimeseries = "FIND_MATCHED_NO_TIMESERIES" GroupByMissingProperty = "GROUPBY_MISSING_PROPERTY" )
const ( AuthenticatedType = "authenticated" ControlMessageType = "control-message" ErrorType = "error" MetadataType = "metadata" MessageType = "message" DataType = "data" EventType = "event" WebsocketErrorType = "websocket-error" ExpiredTSIDType = "expired-tsid" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedMessage ¶
type AuthenticatedMessage struct { BaseJSONMessage OrgID string `json:"orgId"` UserID string `json:"userId"` }
type BaseChannelMessage ¶
type BaseChannelMessage struct {
Chan string `json:"channel,omitempty"`
}
func (*BaseChannelMessage) Channel ¶
func (bcm *BaseChannelMessage) Channel() string
type BaseControlMessage ¶
type BaseControlMessage struct { BaseJSONChannelMessage TimestampedMessage Event string `json:"event"` }
type BaseJSONChannelMessage ¶
type BaseJSONChannelMessage struct { BaseJSONMessage BaseChannelMessage }
func (*BaseJSONChannelMessage) String ¶
func (j *BaseJSONChannelMessage) String() string
type BaseJSONMessage ¶
type BaseJSONMessage struct { BaseMessage // contains filtered or unexported fields }
func (*BaseJSONMessage) JSONBase ¶
func (bjm *BaseJSONMessage) JSONBase() *BaseJSONMessage
func (*BaseJSONMessage) RawData ¶
func (j *BaseJSONMessage) RawData() map[string]interface{}
The raw message deserialized from JSON. Only applicable for JSON Useful if the message type doesn't have a concrete struct type implemented in this library (e.g. due to an upgrade to the SignalFlow protocol).
func (*BaseJSONMessage) String ¶
func (j *BaseJSONMessage) String() string
type BaseMessage ¶
type BaseMessage struct {
Typ string `json:"type"`
}
func (*BaseMessage) Base ¶
func (bm *BaseMessage) Base() *BaseMessage
func (*BaseMessage) String ¶
func (bm *BaseMessage) String() string
func (*BaseMessage) Type ¶
func (bm *BaseMessage) Type() string
type BinaryMessageHeader ¶ added in v1.6.2
type BinaryMessageHeader struct { Version uint8 MessageType uint8 Flags uint8 Reserved uint8 Channel [16]byte }
BinaryMessageHeader represents the first 20 bytes of every binary websocket message from the backend. https://developers.signalfx.com/signalflow_analytics/rest_api_messages/stream_messages_specification.html#_binary_encoding_of_websocket_messages
type ChannelMessage ¶
type ChannelMessage interface {
Channel() string
}
type DataMessage ¶
type DataMessage struct { BaseMessage BaseChannelMessage TimestampedMessage Payloads []DataPayload }
DataMessage is a set of datapoints that share a common timestamp
func (*DataMessage) String ¶
func (dm *DataMessage) String() string
type DataMessageHeader ¶ added in v1.6.2
type DataPayload ¶ added in v1.6.2
func (*DataPayload) Float64 ¶ added in v1.6.2
func (dp *DataPayload) Float64() float64
func (*DataPayload) Int32 ¶ added in v1.6.2
func (dp *DataPayload) Int32() int32
func (*DataPayload) Int64 ¶ added in v1.6.2
func (dp *DataPayload) Int64() int64
func (*DataPayload) Value ¶ added in v1.6.2
func (dp *DataPayload) Value() interface{}
Value returns the numeric value as an interface{}.
type ErrorContext ¶
type ErrorMessage ¶
type ErrorMessage struct { BaseJSONChannelMessage Context ErrorContext `json:"context"` Error int `json:"error"` ErrorType string `json:"errorType"` Message string `json:"message"` }
type EventMessage ¶
type EventMessage struct {
BaseJSONChannelMessage
}
type ExpiredTSIDMessage ¶
type ExpiredTSIDMessage struct { BaseJSONChannelMessage TSID string `json:"tsId"` }
ExpiredTSIDMessage is received when a timeseries has expired and is no longer relvant to a computation.
type FindLimitedResultSetContents ¶ added in v1.6.28
type FindLimitedResultSetContents map[string]interface{}
func (FindLimitedResultSetContents) LimitSize ¶ added in v1.6.28
func (jm FindLimitedResultSetContents) LimitSize() int
func (FindLimitedResultSetContents) MatchedSize ¶ added in v1.6.28
func (jm FindLimitedResultSetContents) MatchedSize() int
type FindMatchedNoTimeseriesContents ¶ added in v1.7.4
type FindMatchedNoTimeseriesContents map[string]interface{}
func (FindMatchedNoTimeseriesContents) MatchedNoTimeseriesQuery ¶ added in v1.7.4
func (jm FindMatchedNoTimeseriesContents) MatchedNoTimeseriesQuery() string
type GroupByMissingPropertyContents ¶ added in v1.7.4
type GroupByMissingPropertyContents map[string]interface{}
func (GroupByMissingPropertyContents) GroupByMissingProperties ¶ added in v1.7.4
func (jm GroupByMissingPropertyContents) GroupByMissingProperties() []string
type InfoMessage ¶
type InfoMessage struct { BaseJSONChannelMessage LogicalTimestampMillis uint64 `json:"logicalTimestampMs"` MessageBlock `json:"message"` }
func (*InfoMessage) LogicalTimestamp ¶
func (im *InfoMessage) LogicalTimestamp() time.Time
func (*InfoMessage) UnmarshalJSON ¶
func (im *InfoMessage) UnmarshalJSON(raw []byte) error
type JSONMessage ¶
type JSONMessage interface { Message JSONBase() *BaseJSONMessage RawData() map[string]interface{} }
type JobDetectedLagContents ¶
type JobDetectedLagContents map[string]interface{}
func (JobDetectedLagContents) LagMS ¶
func (jm JobDetectedLagContents) LagMS() int
type JobInitialMaxDelayContents ¶
type JobInitialMaxDelayContents map[string]interface{}
func (JobInitialMaxDelayContents) MaxDelayMS ¶
func (jm JobInitialMaxDelayContents) MaxDelayMS() int
type JobRunningResolutionContents ¶
type JobRunningResolutionContents map[string]interface{}
func (JobRunningResolutionContents) ResolutionMS ¶
func (jm JobRunningResolutionContents) ResolutionMS() int
type JobStartControlMessage ¶
type JobStartControlMessage struct { BaseControlMessage Handle string `json:"handle"` }
type Message ¶
type Message interface { Type() string Base() *BaseMessage }
type MessageBlock ¶
type MessageBlock struct { TimestampedMessage Code string `json:"messageCode"` Level string `json:"messageLevel"` NumInputTimeseries int `json:"numInputTimeSeries"` // If the messageCode field in the message is known, this will be an // instance that has more specific methods to access the known fields. You // can always access the original content by treating this value as a // map[string]interface{}. Contents interface{} `json:"-"` ContentsRaw map[string]interface{} `json:"contents"` }
type MetadataMessage ¶
type MetadataMessage struct { BaseJSONChannelMessage TSID idtool.ID `json:"tsId"` Properties MetadataProperties `json:"properties"` }
type MetadataProperties ¶
type MetadataProperties struct { Metric string `json:"sf_metric"` OriginatingMetric string `json:"sf_originatingMetric"` ResolutionMS int `json:"sf_resolutionMs"` CreatedOnMS int `json:"sf_createdOnMs"` // Additional SignalFx-generated properties about this time series. Many // of these are exposed directly in fields on this struct. InternalProperties map[string]interface{} `json:"-"` // Custom properties applied to the timeseries through various means, // including dimensions, properties on matching dimensions, etc. CustomProperties map[string]string `json:"-"` }
func (*MetadataProperties) MarshalJSON ¶ added in v1.6.2
func (mp *MetadataProperties) MarshalJSON() ([]byte, error)
func (*MetadataProperties) UnmarshalJSON ¶
func (mp *MetadataProperties) UnmarshalJSON(b []byte) error
type TimestampedMessage ¶
type TimestampedMessage struct {
TimestampMillis uint64 `json:"timestampMs"`
}
func (*TimestampedMessage) Timestamp ¶
func (tsm *TimestampedMessage) Timestamp() time.Time