pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(exp time.Duration) *Cache

func (*Cache) Cleanup

func (c *Cache) Cleanup()

func (*Cache) Copy

func (c *Cache) Copy() map[string]any

func (*Cache) Load

func (c *Cache) Load(key string) (any, bool)

func (*Cache) Store

func (c *Cache) Store(key string, v any)

type CacheValue

type CacheValue struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Prometheus  ConfigPrometheus   `yaml:"prometheus"`
	Expressions []ConfigExperssion `yaml:"expressions"`
	Cache       ConfigCache
	Http        ConfigHttp `yaml:"http"`
}

func NewConfig

func NewConfig(path string) (*Config, error)

type ConfigCache

type ConfigCache struct {
	Expiration int64 `yaml:"expire"`
}

type ConfigExperssion

type ConfigExperssion struct {
	Name       string `yaml:"name"`
	Query      string `yaml:"query"`
	Experssion string `yaml:"expr"`
}

type ConfigHttp

type ConfigHttp struct {
	Addr string `yaml:"addr"`
}

type ConfigPrometheus

type ConfigPrometheus struct {
	Addr string `yaml:"addr"`
}

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(config *Config, cache *Cache) (*Metrics, error)

func (*Metrics) Update

func (m *Metrics) Update() error

Jump to

Keyboard shortcuts

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