gce

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: 14 Imported by: 0

Documentation

Overview

Package gce implements Google Compute Engine (GCE) targets for Cloudprober.

It currently supports following GCE targets:

Instances
Forwarding Rules (only regional currently)

Targets are configured through a config file, based on the protobuf defined in the config.proto file in the same directory. Example config:

All instances matching a certain regex:

targets {
  gce_targets {
    instances {}
  }
  regex: "ig-proxy-.*"
}

Public IP of all instances matching a certain regex:

targets {
  gce_targets {
    instances {
      public_ip: true
    }
  }
  regex: "ig-proxy-.*"
}

All forwarding rules in the local region:

targets {
  gce_targets {
    forwarding_rules {}
  }
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Targets

type Targets interface {
	// List produces list of targets.
	List() []string
	// Resolve, given a target name and IP Version will return the IP address for
	// that target.
	Resolve(name string, ipVer int) (net.IP, error)
}

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(conf *configpb.TargetsConf, opts *configpb.GlobalOptions, res *dnsRes.Resolver, log *logger.Logger) (t Targets, err error)

New is a helper function to unpack a Targets proto into a Targets interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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