sources

package
v0.0.0-...-45bf3f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedSources

type CachedSources struct {
	Cache *cache.Cache
}

func NewCachedSources

func NewCachedSources(defaultExpration, cleanupInterval time.Duration) *CachedSources

func (*CachedSources) GetSource

func (cs *CachedSources) GetSource(reference string) (evalexpr.Source, error)

func (*CachedSources) SetSource

func (cs *CachedSources) SetSource(reference string, source evalexpr.Source, expirationPeriod time.Duration) error

func (*CachedSources) SetValue

func (cs *CachedSources) SetValue(reference string, value interface{}) error

type MemorySource

type MemorySource struct {
	Value interface{}
}

func NewMemorySource

func NewMemorySource(value interface{}) *MemorySource

func (*MemorySource) GetValue

func (ms *MemorySource) GetValue() (interface{}, error)

type MemorySources

type MemorySources struct {
	SourceMap map[string]evalexpr.Source
}

func NewMemorySources

func NewMemorySources() *MemorySources

func (*MemorySources) GetSource

func (ms *MemorySources) GetSource(reference string) (evalexpr.Source, error)

func (*MemorySources) SetSource

func (ms *MemorySources) SetSource(reference string, source evalexpr.Source) error

func (*MemorySources) SetValue

func (ms *MemorySources) SetValue(reference string, value interface{}) error

type PrometheusSource

type PrometheusSource struct {
	Address string
	Query   string
}

func NewPrometheusSource

func NewPrometheusSource(address, query string) *PrometheusSource

func (*PrometheusSource) GetValue

func (ps *PrometheusSource) GetValue() (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL