rtc

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rtc implements runtime-configurator (RTC) based targets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Targets

type Targets struct {
	// contains filtered or unexported fields
}

Targets implements the lister interface to provide RTC based target listing. Provides a means of listing targets stored in a Runtime Configuration value set. For information on how the RTC API works, see https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/

Each variable in RTC is a key/val pair. When listing targets, we assume the variables in the rtcservice.Config are laid out as <Hostname : RtcTargetInfo> where RtcTargetInfo is a base64 encoded RtcTargetInfo protobuf. The hostnames are listed, with one of their addresses assigned as a solve address. If groupTag is empty, no filtering by groupTag occurs. Otherwise, only variables with a group_tag matching an element of groupTag will be listed.

Note that this only provides a means to list targets stored in an RTC config. It does not provide means to maintain this list. When listing, however, Targets will ignore sufficiently old RTC entries, as configured by "exp_msec" in the TargetsConf protobuf.

func New

func New(pb *configpb.TargetsConf, localProject string, l *logger.Logger) (*Targets, error)

New returns an rtc resolver / lister, given a defining protobuf.

func (*Targets) List

func (t *Targets) List() []string

List produces a list of targets found in the RTC configuration for this project. It ignores all sufficiently old RTC entries, as configured by "exp_msec" in the TargetsConf protobuf. Then entries will be filtered by group names, if "groups" was non-empty. If there is an empty intersection between "groups" and the groups in RtcTargetInfo, the entry will be filtered out.

func (*Targets) Resolve

func (t *Targets) Resolve(name string, ipVer int) (net.IP, error)

Resolve returns the address that was associated with a given hostname. ipVer is currently ignored.

Directories

Path Synopsis
Package rtcreporter implements a reporting mechanism for RTC targets.
Package rtcreporter implements a reporting mechanism for RTC targets.
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