targets

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

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

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

func SetSharedTargets(name string, tgts Targets)

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 {
	endpoint.Lister
	endpoint.Resolver
}

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 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 StaticEndpoints added in v0.12.3

func StaticEndpoints(eps []endpoint.Endpoint) Targets

func StaticTargets

func StaticTargets(hosts string) Targets

StaticTargets returns a basic "targets" object (implementing the Targets interface) from a comma-separated list of hosts. This function panics if "hosts" string is not valid. It is mainly used by tests to quickly get a targets.Targets object from a list of hosts.

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 file implements a file-based targets for cloudprober.
Package file implements a file-based targets for cloudprober.
gce
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.
rtc
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL