config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace for all metrics.
	Namespace = "custom"
	// Subsystem(s).
	Exporter = "exporter"
)

Metric name parts.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Metrics map[string]MetricsItem
}

func NewConfig

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

func (Config) ValueType

func (e Config) ValueType(Value_type string) prometheus.ValueType

type ConfigYaml

type ConfigYaml struct {
	Credentials []CredentialsItem `yaml:"credentials"`
	Metrics     []MetricsItemYaml `yaml:"metrics"`
}

type CredentialsItem

type CredentialsItem struct {
	Name      string `yaml:"name"`
	Collector string `yaml:"type"`

	User string `yaml:"user,omitempty"`
	Dsn  string `yaml:"dsn,omitempty"`
	Uri  string `yaml:"uri,omitempty"`
	Path string `yaml:"path,omitempty"`
}

type CredentialsUser

type CredentialsUser struct {
	user.User
}

func (CredentialsUser) GidInt

func (c CredentialsUser) GidInt() uint32

func (CredentialsUser) UidInt

func (c CredentialsUser) UidInt() uint32

type MetricsItem

type MetricsItem struct {
	Name     string
	Commands []string

	Credential CredentialsItem

	Mapping    []string
	Separator  string
	Value_name string
	Value_type prometheus.ValueType
}

func (MetricsItem) CredentialUser

func (m MetricsItem) CredentialUser() *CredentialsUser

func (MetricsItem) SeparatorValue

func (m MetricsItem) SeparatorValue() string

type MetricsItemYaml

type MetricsItemYaml struct {
	Name     string   `yaml:"name"`
	Commands []string `yaml:"commands"`

	Credential string `yaml:"credential"`

	Mapping    []string `yaml:"mapping"`
	Separator  string   `yaml:"separator,omitempty"`
	Value_name string   `yaml:"value_name,omitempty"`
	Value_type string   `yaml:"value_type"`
}

Jump to

Keyboard shortcuts

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