Documentation
¶
Overview ¶
Package message provides functions for managing data used by conditions and transforms.
Index ¶
- func AsControl() func(*Message)
- type Message
- func (m *Message) Data() []byte
- func (m *Message) DeleteValue(key string) error
- func (m *Message) GetValue(key string) Value
- func (m *Message) IsControl() bool
- func (m *Message) Metadata() []byte
- func (m *Message) SetData(data []byte) *Message
- func (m *Message) SetMetadata(metadata []byte) *Message
- func (m *Message) SetValue(key string, value interface{}) error
- func (m *Message) String() string
- type Value
- func (v Value) Array() []Value
- func (v Value) Bool() bool
- func (v Value) Bytes() []byte
- func (v Value) Exists() bool
- func (v Value) Float() float64
- func (v Value) Int() int64
- func (v Value) IsArray() bool
- func (v Value) Map() map[string]Value
- func (v Value) String() string
- func (v Value) Uint() uint64
- func (v Value) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is the data structure that is handled by transforms and interpreted by conditions.
Data in each message may be JSON text or binary data:
- JSON text is accessed using the GetValue, SetValue, and DeleteValue methods.
- Binary data is accessed using the Data and SetData methods.
Metadata is a second data field that is meant to store information about the message, but can be used for any purpose. For JSON text, metadata is accessed using the GetValue, SetValue, and DeleteValue methods with a key prefixed with "meta ". Binary metadata is accessed using the Metadata and SetMetadata methods.
Messages can also be configured as "control messages." Control messages are used for flow control in Substation functions and applications, but can be used for any purpose depending on the needs of a transform or condition. These messages should not contain data or metadata.