Documentation
¶
Overview ¶
Package metadata describes metadata paths stored in the cache per target.
Index ¶
- Constants
- Variables
- func Path(value string) []string
- type Metadata
- func (m *Metadata) AddInt(value string, i int64) error
- func (m *Metadata) Clear()
- func (m *Metadata) GetBool(value string) (bool, error)
- func (m *Metadata) GetInt(value string) (int64, error)
- func (m *Metadata) SetBool(value string, v bool) error
- func (m *Metadata) SetInt(value string, v int64) error
Constants ¶
View Source
const ( // Root node where metadata is cached. Root = "meta" // Sync is a boolean that reports whether all target state is cached. Sync = "sync" // Connected is a boolean that reports whether updates are being received. Connected = "connected" // AddCount is the total number of leaves that have been added. AddCount = "targetLeavesAdded" // DelCount is the total number of leaves that have been deleted. DelCount = "targetLeavesDeleted" // LeafCount is the current total leaves stored in the cache. LeafCount = "targetLeaves" // UpdateCount is the total number of leaf updates received. UpdateCount = "targetLeavesUpdated" // StaleCount is the total number of leaf updates that had timestamp older // than that cached. StaleCount = "targetLeavesStale" // SuppressedCount is the total number of leaf updates that were suppressed // because the update had the same value as already cached. SuppressedCount = "targetLeavesSuppressed" // LatencyAvg is the average latency between target timestamp and cache // reception. LatencyAvg = "latencyAvg" // LatencyMax is the maximum latency between target timestamp and cache // reception. LatencyMax = "latencyMax" // LatencyMin is the minimum latency between target timestamp and cache // reception. LatencyMin = "latencyMin" // Size is the total number of bytes used to store all values. This count // excludes all indexing overhead. Size = "targetSize" // LatestTimestamp is the latest timestamp for any update received for the // target. LatestTimestamp = "latestTimestamp" )
Variables ¶
View Source
var ( // TargetBoolValues is the list of all bool metadata fields. TargetBoolValues = map[string]bool{ Sync: true, Connected: true, } // TargetIntValues is the list of all int64 metadata fields. TargetIntValues = map[string]bool{ AddCount: true, DelCount: true, LeafCount: true, UpdateCount: true, StaleCount: true, SuppressedCount: true, LatencyAvg: true, LatencyMax: true, LatencyMin: true, Size: true, LatestTimestamp: true, } )
View Source
var ErrInvalidValue = errors.New("invalid metadata value")
ErrInvalidValue is returned when a metadata operation is attempted on a value that does not exist.
View Source
var ErrUnsetValue = errors.New("unset value")
ErrUnsetValue is returned when a metadata Get is attempted on a value that has not been Set (or Added).
Functions ¶
Types ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata is the container for all target specific metadata.
func New ¶
func New() *Metadata
New returns an initialized Metadata structure. Integer values are initialized to 0 and boolean values are initialized to false.
Click to show internal directories.
Click to hide internal directories.