registry

package
v0.0.0-...-29da2f4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCredentials

func AddCredentials(name string, f InitCredentials)

func AddSource

func AddSource(name string, f InitSource)

Types

type Credentials

type Credentials interface {
	Plugin
	Credentials(c context.Context) (Session, error)
}

type InitCredentials

type InitCredentials func(cred Session) Credentials

InitCredentials returns a partially initialised instance of Plugin. If configured with "from", the parent credentials are passed as an argument.

func GetCredentials

func GetCredentials(name string) (InitCredentials, error)

type InitSource

type InitSource func(cred Session) Source

func GetSource

func GetSource(name string) (InitSource, error)

type Initializer

type Initializer interface {
	Init() error
}

Initializer, when implemented by a plugin, is invoked once after reading its configuration.

type Plugin

type Plugin interface {
	Description() string
	DefaultConfig() string
}

type Session

type Session interface{}

type Source

type Source interface {
	Plugin
	Source(c context.Context, collector metric.Collector) error
}

Plugin is something that can collect metrics. It should submit the metrics to the channel provided, which the source should not close. A source returns once all of its metrics have been collected.

A source may be long-lived, and partake in several executions with significant time-spacing.

Jump to

Keyboard shortcuts

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