Documentation ¶
Index ¶
- Variables
- type Discovery
- type Parameters
- type Resource
- type SDConfig
- func (*SDConfig) Name() string
- func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
- func (*SDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
- func (c *SDConfig) SetDirectory(dir string)
- func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultSDConfig is the default PuppetDB SD configuration. DefaultSDConfig = SDConfig{ RefreshInterval: model.Duration(60 * time.Second), Port: 80, HTTPClientConfig: config.DefaultHTTPClientConfig, } )
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
Discovery provides service discovery functionality based on PuppetDB resources.
func NewDiscovery ¶
func NewDiscovery(conf *SDConfig, logger log.Logger, metrics discovery.DiscovererMetrics) (*Discovery, error)
NewDiscovery returns a new PuppetDB discovery for the given config.
type Parameters ¶
type Parameters map[string]interface{}
type Resource ¶
type Resource struct { Certname string `json:"certname"` Resource string `json:"resource"` Type string `json:"type"` Title string `json:"title"` Exported bool `json:"exported"` Tags []string `json:"tags"` File string `json:"file"` Environment string `json:"environment"` Parameters Parameters `json:"parameters"` }
type SDConfig ¶
type SDConfig struct { HTTPClientConfig config.HTTPClientConfig `yaml:",inline"` RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"` URL string `yaml:"url"` Query string `yaml:"query"` IncludeParameters bool `yaml:"include_parameters"` Port int `yaml:"port"` }
SDConfig is the configuration for PuppetDB based discovery.
func (*SDConfig) NewDiscoverer ¶
func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
NewDiscoverer returns a Discoverer for the Config.
func (*SDConfig) NewDiscovererMetrics ¶
func (*SDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
NewDiscovererMetrics implements discovery.Config.
func (*SDConfig) SetDirectory ¶
SetDirectory joins any relative file paths with dir.
func (*SDConfig) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.