storage

package
v0.0.0-...-8dad1ad Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRedis

func InitRedis()

func InitStorage

func InitStorage()

Types

type BaseMetricClient

type BaseMetricClient interface {
	Emit(ctx context.Context, metric Metric) error
}
var MetricsClient BaseMetricClient

type Influx2Client

type Influx2Client struct {
	Client influxdb2.Client
	Writer influxapi.WriteAPI
}

func NewInflux2Client

func NewInflux2Client() (client Influx2Client, err error)

func (Influx2Client) Emit

func (i Influx2Client) Emit(ctx context.Context, metric Metric) (err error)

type InfluxClient

type InfluxClient struct {
	Client influxdb2.Client
	Writer influxapi.WriteAPI
}

TODO: implement influx1

func NewInfluxClient

func NewInfluxClient() (client InfluxClient, err error)

func (InfluxClient) Emit

func (i InfluxClient) Emit(ctx context.Context, metric Metric) (err error)

type Metric

type Metric struct {
	Name   string
	Values map[string]interface{}
	Tags   map[string]string

	Timestamp *time.Time
}

type RedisClient

type RedisClient struct {
	Client *redis.Client
}
var WrappedRedis *RedisClient

func (*RedisClient) AppendLog

func (r *RedisClient) AppendLog(ctx context.Context, key string, values map[string]string) error

Jump to

Keyboard shortcuts

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