Documentation ¶
Index ¶
- func GetTargets(targets []labels.Labels, port, group string) ([]labels.Labels, error)
- func MarshalYAMLWithInlineConfigs(in interface{}) (interface{}, error)
- func RegisterConfig(config Config)
- func UnmarshalYAMLWithInlineConfigs(out interface{}, unmarshal func(interface{}) error) error
- type Config
- type Configs
- type Module
- type ModuleOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTargets ¶
GetTargets transforms targets into prometheus targets
func MarshalYAMLWithInlineConfigs ¶
func MarshalYAMLWithInlineConfigs(in interface{}) (interface{}, error)
MarshalYAMLWithInlineConfigs helps implement yaml.Marshal for structs that have a Configs field that should be inlined.
func RegisterConfig ¶
func RegisterConfig(config Config)
RegisterConfig registers the given Config type for YAML marshaling and unmarshaling.
func UnmarshalYAMLWithInlineConfigs ¶
UnmarshalYAMLWithInlineConfigs helps implement yaml.Unmarshal for structs that have a Configs field that should be inlined.
Types ¶
type Config ¶
type Config interface { // Name returns the name of the discovery mechanism. Name() string // IsEnabled returns a boolean indicating if the Module is enabled. IsEnabled() bool // NewModule returns a Discoverer for the Config // with the given DiscovererOptions. NewModule(ModuleOptions) (Module, error) }
A Config provides the configuration and constructor for a Module.
type Configs ¶
type Configs []Config
Configs is a slice of Config values that uses custom YAML marshaling and unmarshaling to represent itself as a mapping of the Config values grouped by their types.
func (Configs) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.
func (*Configs) SetDirectory ¶
SetDirectory joins any relative file paths with dir.
func (*Configs) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type Module ¶
type Module interface { Playbook(context.Context) (*ansible.Playbook, error) HostVars() (map[string]string, error) GetTargets([]labels.Labels, string) ([]labels.Labels, error) GetRules(string) rulefmt.RuleGroup GetDashboards() []map[string]interface{} GetDashboardFiles() map[string][]byte }
Module is the interface for modules.
type ModuleOptions ¶
ModuleOptions provides options for a Module.