Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Authenticator authenticator.Authenticator Endpoints []config.Endpoint Timeout time.Duration }
type ConnParams ¶
ConnParams contains the authenticated parameters to scrape an endpoint.
type Connector ¶
type Connector interface { // Connect probes the connector endpoints and returns connParams to scrape a valid endpoint. Connect() (*ConnParams, error) }
Connector provides an interface to retrieve connParams to connect to a Control Plane instance.
type DefaultConnector ¶
type DefaultConnector struct { Config // contains filtered or unexported fields }
DefaultConnector implements Connector interface for the Control Plane components.
func New ¶
func New(config Config, opts ...OptionFunc) (*DefaultConnector, error)
New returns a DefaultConnector.
func (*DefaultConnector) Connect ¶
func (dp *DefaultConnector) Connect() (*ConnParams, error)
Connect iterates over the endpoints list probing each endpoint with a HEAD request and returns the connection parameters of the first endpoint that respond Status OK.
type OptionFunc ¶
type OptionFunc func(dc *DefaultConnector) error
func WithLogger ¶
func WithLogger(logger *log.Logger) OptionFunc
WithLogger returns an OptionFunc to change the logger from the default noop logger.
Click to show internal directories.
Click to hide internal directories.