Documentation ¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RDSClientConf ¶ added in v0.10.5
func RDSClientConf(pb *targetspb.RDSTargets, globalOpts *targetspb.GlobalTargetsOptions) (rdsclient.ListResourcesFunc, *clientconfigpb.ClientConf, error)
RDSClientConf converts RDS targets into RDS client configuration.
func RegisterTargetsType ¶
func RegisterTargetsType(extensionFieldNo int, newTargetsFunc func(interface{}, *logger.Logger) (Targets, error))
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.
func SetSharedTargets ¶ added in v0.10.5
SetSharedTargets adds given targets to an internal map. These targets can then be referred by multiple probes through "shared_targets" option.
Types ¶
type Targets ¶
type Targets interface {
// contains filtered or unexported methods
}
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 ¶
func New(targetsDef *targetspb.TargetsDef, ldLister lameduck.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).
Directories ¶
Path | Synopsis |
---|---|
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 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 rtc implements runtime-configurator (RTC) based targets.
|
Package rtc implements runtime-configurator (RTC) based targets. |
rtcreporter
Package rtcreporter implements a reporting mechanism for RTC targets.
|
Package rtcreporter implements a reporting mechanism for RTC targets. |
rtcservice
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. |