Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSingleGTS = errors.New("FIND on selector doesn't not return a single GTS")
ErrNotSingleGTS is the error thrown when call on FIND doesn't return [1]
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
ReadToken string
WriteToken string
Endpoint string
WebSocketProtol string
HTTPProtocol string
ForceSyncInterval *time.Duration
HTTPClient *http.Client
}
Configuration is holding the configuration for one cache
type MultipleCache ¶
type MultipleCache struct {
// contains filtered or unexported fields
}
MultipleCache is watching other multiples GTS
func NewMultipleCache ¶
func NewMultipleCache(s Selector, pivot string, c Configuration) (*MultipleCache, error)
NewMultipleCache is creating a new MultipleCache
func (*MultipleCache) Copy ¶
func (c *MultipleCache) Copy() map[string]float64
Copy is returning a copy of the map
func (*MultipleCache) Get ¶
func (c *MultipleCache) Get(label string) float64
Get is returning the latest value for a MultipleCache
func (*MultipleCache) Inc ¶
func (c *MultipleCache) Inc(label string)
Inc is incrementing the value. Cache is updated and a new datapoint is pushed
func (*MultipleCache) Set ¶
func (c *MultipleCache) Set(label string, f float64)
Set is setting a new value. Cache is updated and a new datapoint is pushed
type SingleCache ¶
type SingleCache struct {
// contains filtered or unexported fields
}
SingleCache is a cache for a single GTS. To watch multiple GTS at the same time, please use MultipleCache
func NewSingleCache ¶
func NewSingleCache(s Selector, c Configuration) (*SingleCache, error)
NewSingleCache is creating a new SingleCache
func (*SingleCache) Get ¶
func (c *SingleCache) Get() float64
Get is returning the latest value for a SingleCache
func (*SingleCache) Inc ¶
func (c *SingleCache) Inc()
Inc is incrementing the value. Cache is updated and a new datapoint is pushed
func (*SingleCache) Set ¶
func (c *SingleCache) Set(f float64)
Set is setting a new value. Cache is updated and a new datapoint is pushed