targets

package
v0.0.0-...-e1c190b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: Apache-2.0 Imports: 14 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 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.

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, targetOpts *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

func StaticTargets(hosts string) Targets

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
gce
Package gce implements Google Compute Engine (GCE) targets for Cloudprober.
Package gce implements Google Compute Engine (GCE) targets for Cloudprober.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package lameduck implements a lameducks provider.
Package lameduck implements a lameducks provider.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package resolver provides a caching, non-blocking DNS resolver.
Package resolver provides a caching, non-blocking DNS resolver.
rtc
Package rtc implements runtime-configurator (RTC) based targets.
Package rtc implements runtime-configurator (RTC) based targets.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
rtcreporter
Package rtcreporter implements a reporting mechanism for RTC targets.
Package rtcreporter implements a reporting mechanism for RTC targets.
rtcreporter/proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
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