Documentation
¶
Index ¶
Constants ¶
const IDSeparator string = "§"
IDSeparator is used for key definition system symbol. Should be a control character, i.e. invalid namespace/entityID symbol.
Variables ¶
This section is empty.
Functions ¶
func FeatureKey ¶
FeatureKey represents a feature database key.
func FeaturesKeyPrefix ¶
FeaturesKeyPrefix represents all thing's features database key prefix.
func SystemThingKey ¶
SystemThingKey returns the SystemThingData key.
Types ¶
type FeatureData ¶
type FeatureData struct { // ID represents the Feature ID. ID string // ThingID matches the feature's thing ID, i.e. the ThingData.ID value. ThingID string // Definition represents model.Feature definitions string representations. Definition []string // Properties represents model.Feature properties. Properties map[string]interface{} // Properties represents model.Feature desired properties. DesiredProperties map[string]interface{} }
FeatureData represents the persistable model.Feature structure.
func (*FeatureData) Data ¶
func (data *FeatureData) Data() interface{}
Data returns the persistable data.
func (*FeatureData) Value ¶
func (data *FeatureData) Value(value interface{})
Value returns the created instance from the stored data.
type StoreData ¶
type StoreData interface { // Key returns the storage key. Key() string // Data returns the persistable data. Data() interface{} // Value returns the created instance from the stored data. Value(interface{}) }
StoreData provides key-value persitable pair
type SystemThingData ¶
type SystemThingData struct { // ThingID matches the model.Thing namespace ID string representation. ID string // Revision represents the thing local revision that is initialised with the added model.Thing // revision and increased on each thing's data modification, including its features modifications. Revision int64 // Timestamp represents the thing local timestamp that is the timestamp of each // thing's data modification, including its features modifications. Timestamp string // DeletedFeatures is a system field that contains the feature IDs of locally deleted features only, // i.e. not synchronized with the remote feature existence state. DeletedFeatures map[string]interface{} // UnsynchronizedFeatures is a system field that contains the feature IDs of locally modified features only, // i.e. not synchronized with the remote feature state. // For each unsynchronized feature the revision for its offline change is stored. UnsynchronizedFeatures map[string]int64 }
SystemThingData is used for Things Storage system data representation.
func (*SystemThingData) Data ¶
func (data *SystemThingData) Data() interface{}
Data returns the persistable data.
func (*SystemThingData) Key ¶
func (data *SystemThingData) Key() string
Key returns the datatabase key.
func (*SystemThingData) Value ¶
func (data *SystemThingData) Value(value interface{})
Value returns the created instance from the stored data.
type ThingData ¶
type ThingData struct { // ThingID matches the model.Thing namespace ID string representation. ID string // PolicyID matches the model.Thing policy ID string representation. PolicyID string // DefinitionID represents the model.Thing definition string representation. DefinitionID string // Attributes represents the model.Thing attributes. Attributes map[string]interface{} }
ThingData represents the persistable model.Thing structure.