event

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListPublishers added in v0.4.0

func ListPublishers() []string

ListPublishers list supported publishers

Types

type ConfigTemplate added in v0.4.0

type ConfigTemplate struct {
	Metrics []MetricTemplate `yaml:"metrics" json:"metrics"`
}

ConfigTemplate is the content of user config

type MetricReading added in v0.4.0

type MetricReading struct {
	ID    string      `json:"id"`
	SrcID string      `json:"src_id"`
	Time  int64       `json:"time"`
	Label string      `json:"label"`
	Data  interface{} `json:"data"`
	Unit  string      `json:"unit"`
}

MetricReading represents generic event

type MetricTemplate added in v0.4.0

type MetricTemplate struct {
	Label     string        `yaml:"label" json:"label"`
	Unit      string        `yaml:"unit" json:"unit"`
	Frequency time.Duration `yaml:"frequency" json:"frequency"`
	Template  ValueTemplate `yaml:"template" json:"template"`
}

MetricTemplate is readings parameter

type Publisher

type Publisher interface {
	Publish(ctx context.Context, e *MetricReading) error
	Close() error
}

Publisher defines the interface for event publisher

type ValueTemplate added in v0.4.0

type ValueTemplate struct {
	Type string      `yaml:"type" json:"type"`
	Min  interface{} `yaml:"min" json:"min"`
	Max  interface{} `yaml:"max" json:"max"`
}

ValueTemplate defines the generation arguments

Jump to

Keyboard shortcuts

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