Documentation
¶
Overview ¶
Package dockerswarm discovers gRPC targets by inspecting Docker services.
Index ¶
Constants ¶
View Source
const ( // DefaultMinPollInterval is the default for the minimum interval at which the // complete service list will be polled. DefaultMinPollInterval = 1 * time.Second // DefaultServerPort is the default TCP port used to connect to discovered // gRPC servers. DefaultServerPort = "https" )
View Source
const ( // ServiceIDKey is the target meta-data key for the Docker service ID. ServiceIDKey key = "docker.service.id" // ServiceNameKey is the target meta-data key for the Docker service name. ServiceNameKey key = "docker.service.name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NetworkInspect(context.Context, string, types.NetworkInspectOptions) (types.NetworkResource, error) ServiceList(context.Context, types.ServiceListOptions) ([]swarm.Service, error) Events(context.Context, types.EventsOptions) (<-chan events.Message, <-chan error) }
Client is an interface for the subset of the Docker client used by the Discoverer.
type Discoverer ¶
type Discoverer struct { // Registry is the target registry to populate with discovered targets. Registry *flashlight.TargetRegistry // Client is the Docker client used to consume events and query services. Client Client // Network is the name of an overlay network that the services must be on. Network string // Filters is a set of service filters, usually labels, that limits the // services that are considered for discovery. Filters filters.Args // ServerPort is the TCP used to connect to the discovered gRPC servers. // If it is empty, DefaultServerPort is used. ServerPort string // ServerPortLabel is the name a label that can be used to override the // server port on a per-service basis. ServerPortLabel string // MinPollInterval is the minimum interval at which the complete service // list will be polled. MinPollInterval time.Duration // contains filtered or unexported fields }
Discoverer finds gRPC targets by querying the Docker API to find services that match a user-supplied filter.
Click to show internal directories.
Click to hide internal directories.