gce

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 21 Imported by: 5

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 {
	// ListEndpoints produces list of targets.
	ListEndpoints() []endpoint.Endpoint
	// 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 interface is redefined here (originally defined in targets.go) to allow returning private gceResources.

func New

func New(conf *configpb.TargetsConf, globalOpts *configpb.GlobalOptions, res *dnsRes.Resolver, l *logger.Logger) (Targets, 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