Documentation ¶
Overview ¶
Package history with message definitions for reading the history store.
Index ¶
- Constants
- type CursorArgs
- type CursorNArgs
- type CursorNResp
- type CursorReleaseArgs
- type CursorSeekArgs
- type CursorSingleResp
- type GetCursorArgs
- type GetCursorResp
- type GetLatestArgs
- type GetLatestResp
- type GetRetentionRuleArgs
- type GetRetentionRuleResp
- type GetRetentionRulesResp
- type RetentionRule
- type RetentionRuleSet
- type SetRetentionRulesArgs
Constants ¶
const ( // CursorFirstMethod return the oldest value in the history CursorFirstMethod = "cursorFirst" // CursorLastMethod return the newest value in the history CursorLastMethod = "cursorLast" // CursorNextMethod returns the next value in the history CursorNextMethod = "cursorNext" // CursorPrevMethod returns the previous value in the history CursorPrevMethod = "cursorPrev" )
cursor methods that take the key as arg and returns a value
const CursorNextNMethod = "cursorNextN"
CursorNextNMethod returns a batch of next N historical values
const CursorPrevNMethod = "cursorPrevN"
CursorPrevNMethod returns a batch of prior N historical values
const CursorReleaseMethod = "cursorRelease"
CursorReleaseMethod releases the cursor and resources This MUST be called after the cursor is not longer used.
const CursorSeekMethod = "cursorSeek"
CursorSeekMethod seeks the starting point in time for iterating the history This returns a single value response with the value at timestamp or next closest if it doesn't exist. Returns empty value when there are no values at or past the given timestamp
const GetCursorMethod = "getCursor"
GetCursorMethod returns a cursor to iterate the history of a thing The cursor MUST be released after use. The cursor will expire after not being used for the default expiry period.
const GetLatestMethod = "getLatest"
GetLatestMethod returns the latest values of a Thing.
const GetRetentionRuleMethod = "getRetentionRule"
GetRetentionRuleMethod returns the first retention rule that applies to the given value.
const GetRetentionRulesMethod = "getRetentionRules"
GetRetentionRulesMethod returns the collection of retention configurations
const ManageHistoryCap = "manageHistory"
ManageHistoryCap is the capabilityID for managing history
const ReadHistoryCap = "readHistory"
ReadHistoryCap is the capability ID to read the history
const ServiceName = "history"
ServiceName is the agent name of the default instance of the service
const SetRetentionRulesMethod = "setRetentionRules"
SetRetentionRulesMethod updates the set of retention rules
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CursorArgs ¶
type CursorArgs struct { // Cursor identifier obtained with GetCursor CursorKey string `json:"cursorKey"` }
CursorArgs contain the cursor request for use in First,Last,Next,Prev
type CursorNArgs ¶
type CursorNArgs struct { // Cursor identifier obtained with GetCursor CursorKey string `json:"cursorKey"` // Maximum number of results to return Limit int `json:"limit"` }
CursorNArgs contains the request for use in NextN and PrevN
type CursorNResp ¶
type CursorNResp struct { // Returns up to 'Limit' iterated values. // This will be an empty list when trying to read past the last value. Values []*thing.ThingValue `json:"values"` // There are still items remaining. ItemsRemaining bool `json:"itemsRemaining"` }
CursorNResp contains the batch response to a cursor request
type CursorReleaseArgs ¶
type CursorReleaseArgs struct { // Cursor identifier obtained with GetCursor CursorKey string `json:"cursorKey"` }
type CursorSeekArgs ¶
type CursorSingleResp ¶
type CursorSingleResp struct { // The value at the new cursor position or nil if not valid Value *thing.ThingValue `json:"value"` // The current position holds a valid value Valid bool `json:"valid"` }
CursorSingleResp contains a single response value to a cursor request
type GetCursorArgs ¶
type GetCursorArgs struct { // Agent providing the Thing (required) AgentID string `json:"agentID"` // Thing providing the event to get (required) ThingID string `json:"thingID"` // Name of the event or action whose history to get // Use "" to iterate all events/action of the Thing. Name string `json:"name"` }
GetCursorArgs request arguments:
type GetCursorResp ¶
type GetCursorResp struct { // Cursor identifier // The cursor MUST be released after use. CursorKey string `json:"cursorKey"` }
type GetLatestArgs ¶
type GetLatestArgs struct { // agentID is the ID of the agent that published the Thing values AgentID string `json:"agentID"` // thingID is the ID of the thing whose history to read ThingID string `json:"thingID"` // names is the list of properties or events to return. Use nil for all known properties. Names []string `json:"names"` }
type GetLatestResp ¶
type GetLatestResp struct {
Values []*thing.ThingValue `json:"values"`
}
GetLatestResp returns the latest thing values
type GetRetentionRuleArgs ¶
type GetRetentionRuleResp ¶
type GetRetentionRuleResp struct {
Rule *RetentionRule `json:"rule"`
}
type GetRetentionRulesResp ¶
type GetRetentionRulesResp struct {
Rules RetentionRuleSet `json:"rules"`
}
type RetentionRule ¶
type RetentionRule struct { // Optional, the rule applies to data from this agent AgentID string `yaml:"agentID,omitempty" json:"agentID,omitempty"` // Optional, the rule applies to data from this thing ThingID string `yaml:"thingID,omitempty" json:"thingID,omitempty"` // Optional, the rule applies to events or actions with this name Name string `yaml:"name"` // Retain or not retain based on this rule Retain bool `yaml:"retain" json:"retain"` // Retention age after which to remove the value. 0 to retain indefinitely MaxAge uint64 `yaml:"maxAge"` }
RetentionRule with a retention rule for an event (or action)
type RetentionRuleSet ¶
type RetentionRuleSet map[string][]*RetentionRule
RetentionRuleSet is a map by event/action name with one or more rules for agent/things.
type SetRetentionRulesArgs ¶
type SetRetentionRulesArgs struct {
Rules RetentionRuleSet `json:"rules"`
}