Documentation ¶
Index ¶
- Variables
- type Discovery
- type NerveSDConfig
- func (*NerveSDConfig) Name() string
- func (c *NerveSDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
- func (*NerveSDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
- func (c *NerveSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ServersetSDConfig
- func (*ServersetSDConfig) Name() string
- func (c *ServersetSDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
- func (*ServersetSDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
- func (c *ServersetSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultServersetSDConfig is the default Serverset SD configuration. DefaultServersetSDConfig = ServersetSDConfig{ Timeout: model.Duration(10 * time.Second), } // DefaultNerveSDConfig is the default Nerve SD configuration. DefaultNerveSDConfig = NerveSDConfig{ Timeout: model.Duration(10 * time.Second), } )
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery implements the Discoverer interface for discovering targets from Zookeeper.
func NewDiscovery ¶
func NewDiscovery( srvs []string, timeout time.Duration, paths []string, logger log.Logger, pf func(data []byte, path string) (model.LabelSet, error), ) (*Discovery, error)
NewDiscovery returns a new discovery along Zookeeper parses with the given parse function.
func NewNerveDiscovery ¶
func NewNerveDiscovery(conf *NerveSDConfig, logger log.Logger) (*Discovery, error)
NewNerveDiscovery returns a new Discovery for the given Nerve config.
func NewServersetDiscovery ¶
func NewServersetDiscovery(conf *ServersetSDConfig, logger log.Logger) (*Discovery, error)
NewServersetDiscovery returns a new Discovery for the given serverset config.
type NerveSDConfig ¶
type NerveSDConfig struct { Servers []string `yaml:"servers"` Paths []string `yaml:"paths"` Timeout model.Duration `yaml:"timeout,omitempty"` }
NerveSDConfig is the configuration for AirBnB's Nerve in Zookeeper based discovery.
func (*NerveSDConfig) Name ¶
func (*NerveSDConfig) Name() string
Name returns the name of the Config.
func (*NerveSDConfig) NewDiscoverer ¶
func (c *NerveSDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
NewDiscoverer returns a Discoverer for the Config.
func (*NerveSDConfig) NewDiscovererMetrics ¶ added in v0.50.0
func (*NerveSDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
NewDiscovererMetrics implements discovery.Config.
func (*NerveSDConfig) UnmarshalYAML ¶
func (c *NerveSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type ServersetSDConfig ¶
type ServersetSDConfig struct { Servers []string `yaml:"servers"` Paths []string `yaml:"paths"` Timeout model.Duration `yaml:"timeout,omitempty"` }
ServersetSDConfig is the configuration for Twitter serversets in Zookeeper based discovery.
func (*ServersetSDConfig) Name ¶
func (*ServersetSDConfig) Name() string
Name returns the name of the Config.
func (*ServersetSDConfig) NewDiscoverer ¶
func (c *ServersetSDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
NewDiscoverer returns a Discoverer for the Config.
func (*ServersetSDConfig) NewDiscovererMetrics ¶ added in v0.50.0
func (*ServersetSDConfig) NewDiscovererMetrics(reg prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
NewDiscovererMetrics implements discovery.Config.
func (*ServersetSDConfig) UnmarshalYAML ¶
func (c *ServersetSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.