Package targets provides the means to list and resolve targets for probers in the cloudprober framework. To learn more about the kinds of targets available, first look at the "targets.proto" to see how targets are configured.
The interface targets.Targets is what actually provides the ability to list targets (or, more generally, resources), and is what is used by probers. The targets.New constructor provides a specific Target implementation that wraps filtering functionality over a core target lister.
- func RDSClientConf(pb *targetspb.RDSTargets, globalOpts *targetspb.GlobalTargetsOptions, ...) (rdsclient.ListResourcesFunc, *rdsclientpb.ClientConf, error)
- func RegisterTargetsType(extensionFieldNo int, ...)
- func SetSharedTargets(name string, tgts Targets)
- type Targets
func RDSClientConf ¶
func RDSClientConf(pb *targetspb.RDSTargets, globalOpts *targetspb.GlobalTargetsOptions, l *logger.Logger) (rdsclient.ListResourcesFunc, *rdsclientpb.ClientConf, error)
RDSClientConf converts RDS targets into RDS client configuration.
func RegisterTargetsType ¶
RegisterTargetsType registers a new targets type. New targets types are integrated with the config subsystem using the protobuf extensions.
TODO(manugarg): Add a full example of using extensions.
Targets are able to list and resolve targets with their List and Resolve methods. A single instance of Targets represents a specific listing method --- if multiple sets of resources need to be listed/resolved, a separate instance of Targets will be needed.
func New(targetsDef *targetspb.TargetsDef, ldLister endpoint.Lister, globalOpts *targetspb.GlobalTargetsOptions, globalLogger, l *logger.Logger) (Targets, error)
New returns an instance of Targets as defined by a Targets protobuf (and a GlobalTargetsOptions protobuf). The Targets instance returned will filter a core target lister (i.e. static host-list, GCE instances, GCE forwarding rules, RTC targets) by an optional regex or with the lameduck mechanism.
All information related to creating the Target instance will be logged to globalLogger. The logger "l" will be given to the new Targets instance for future logging. If "l" is not provided, a default instance will be given.
See cloudprober/targets/targets.proto for more information on the possible configurations of Targets.
func StaticTargets ¶
StaticTargets returns a basic "targets" object (implementing the targets interface) from a comma-separated list of hosts. This function is specially useful if you want to get a valid targets object without an associated TargetDef protobuf (for example for testing).
Package endpoint provides the type Endpoint, to be used with the targets.Targets interface.
|Package endpoint provides the type Endpoint, to be used with the targets.Targets interface.|
Package file implements a file-based targets for cloudprober.
|Package file implements a file-based targets for cloudprober.|
Package gce implements Google Compute Engine (GCE) targets for Cloudprober.
|Package gce implements Google Compute Engine (GCE) targets for Cloudprober.|
Package lameduck implements a lameducks provider.
|Package lameduck implements a lameducks provider.|
Package resolver provides a caching, non-blocking DNS resolver.
|Package resolver provides a caching, non-blocking DNS resolver.|
Package rtcservice provides utility functions for the cloudprober project used when dealing with the Runtime Configurator API.
|Package rtcservice provides utility functions for the cloudprober project used when dealing with the Runtime Configurator API.|