xer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CfgYamlFile string
	// contains filtered or unexported fields
}

Config is used to configure the runner

type Dest

type Dest struct {
	URL string `yaml:"url"`

	// Method defines an HTTP method such as
	// POST or PUT
	Method string `yaml:"method"`
}

Dest defines a location and method for sending a collected data set to a destination.

type Endpoint

type Endpoint struct {
	// Name defines the data or metric gathered
	// from this endpoint.
	Name string `yaml:"name"`

	// Description is human readable text about the data,
	// used in HELP section of prometheus metrics.
	Description string `yaml:"description"`

	// URL to GET data
	URL string `yaml:"url"`

	// Type defines the data type as on of
	// text or number
	Type string `yaml:"type"`

	// Metric, if defined is used for numbers
	// to specify a prometheus type of counter or gauge
	Metric string `yaml:"metric"`
}

Endpoint specifies a data collection point for a set of data.

type ResultPackage

type ResultPackage struct {
	Name    string                 `json:"name"`
	Results map[string]interface{} `json:"results"`
}

type Runner

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

Runner starts stop and controls XSets.

func NewRunner

func NewRunner(cfg Config) (*Runner, error)

NewRunner created a Runner from a Config

func (*Runner) Run

func (r *Runner) Run() (chan string, chan error, error)

Run the sets defined in the configuration. a message channel for log output of this potentially infinite process.

type SetCfg added in v1.0.2

type SetCfg struct {
	Sets []XSet `yaml:"sets"`
}

type XSet

type XSet struct {
	// Name is used for the key in the collection map
	// example "service-a", "device-b".
	Name string `yaml:"name"`

	// Frequency is the number of seconds to pause
	// between endpoint polling
	Frequency int `yaml:"frequency"`

	Endpoints []Endpoint `yaml:"endpoints"`
	Dest      Dest       `yaml:"dest"`
	// contains filtered or unexported fields
}

XSet defines a name, destination and polling frequency for a set of data collection endpoints.

Jump to

Keyboard shortcuts

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