Documentation ¶
Overview ¶
Package state contains the state service, an orchestrator microservice which manages device-reported state.
Index ¶
- Constants
- func DeleteStates(networkID string, stateIDs []state_types.ID) error
- func GetGatewayStatus(networkID string, deviceID string) (*models.GatewayStatus, error)
- func GetGatewayStatuses(networkID string, deviceIDs []string) (map[string]*models.GatewayStatus, error)
- func GetState(networkID string, typeVal string, hwID string) (state_types.State, error)
- func GetStateClient() (protos.StateServiceClient, error)
- func GetStates(networkID string, stateIDs []state_types.ID) (state_types.StatesByID, error)
- func NewStateSerde(stateType string, modelPtr serde.ValidateableBinaryConvertible) serde.Serde
- func SearchStates(networkID string, typeFilter []string, keyFilter []string, keyPrefix *string) (state_types.StatesByID, error)
- type ArbitraryJSON
- type StringToStringMap
Constants ¶
const ( ServiceName = "STATE" SerdeDomain = "state" DBTableName = "states" )
const StringMapSerdeType = "string_map"
Variables ¶
This section is empty.
Functions ¶
func DeleteStates ¶
func DeleteStates(networkID string, stateIDs []state_types.ID) error
DeleteStates deletes states specified by the networkID and a list of type and key.
func GetGatewayStatus ¶
func GetGatewayStatus(networkID string, deviceID string) (*models.GatewayStatus, error)
GetGatewayStatus returns the status for an indicated gateway.
func GetGatewayStatuses ¶
func GetGatewayStatuses(networkID string, deviceIDs []string) (map[string]*models.GatewayStatus, error)
GetGatewayStatuses returns the status for indicated gateways, keyed by device ID.
func GetStateClient ¶
func GetStateClient() (protos.StateServiceClient, error)
GetStateClient returns a client to the state service.
func GetStates ¶
func GetStates(networkID string, stateIDs []state_types.ID) (state_types.StatesByID, error)
GetStates returns a map of states specified by the networkID and a list of type and key
func NewStateSerde ¶
func NewStateSerde(stateType string, modelPtr serde.ValidateableBinaryConvertible) serde.Serde
func SearchStates ¶
func SearchStates(networkID string, typeFilter []string, keyFilter []string, keyPrefix *string) (state_types.StatesByID, error)
SearchStates returns all states matching the filter arguments. typeFilter and keyFilter are both OR clauses, and the final predicate applied to the search will be the AND of both filters. If keyPrefix is defined (non-nil and non-empty), it will take precedence the keyFilter argument. e.g.: ["t1", "t2"], ["k1", "k2"] => (t1 OR t2) AND (k1 OR k2)
Types ¶
type ArbitraryJSON ¶
type ArbitraryJSON map[string]interface{}
ArbitraryJSON is a generic map[string]interface{} destination to unmarshal any JSON payload into which implements ValidateableBinaryConvertible. This is used for replicated gateway states which are serialized as protos on the gateway side to avoid double-defining structs in proto and swagger for the time being.
func (*ArbitraryJSON) MarshalBinary ¶
func (j *ArbitraryJSON) MarshalBinary() ([]byte, error)
func (*ArbitraryJSON) UnmarshalBinary ¶
func (j *ArbitraryJSON) UnmarshalBinary(data []byte) error
func (*ArbitraryJSON) ValidateModel ¶
func (j *ArbitraryJSON) ValidateModel() error
type StringToStringMap ¶
StringToStringMap is a generic map that holds key value pair both of type string. This is used on the gateway side in checkin_cli.py to simply test the connection between the cloud and the gateway.
func (*StringToStringMap) MarshalBinary ¶
func (m *StringToStringMap) MarshalBinary() (data []byte, err error)
func (*StringToStringMap) UnmarshalBinary ¶
func (m *StringToStringMap) UnmarshalBinary(data []byte) error
func (*StringToStringMap) ValidateModel ¶
func (m *StringToStringMap) ValidateModel() error
Directories ¶
Path | Synopsis |
---|---|
Package indexer provides tools to define, use, and update state indexers.
|
Package indexer provides tools to define, use, and update state indexers. |
Package types contains the types and associated methods for the state service.
|
Package types contains the types and associated methods for the state service. |