internal

package
v0.0.0-...-ff5f600 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2016 License: BSD-3-Clause Imports: 15 Imported by: 0

README

This directory and all of its subdirectories contain an implementation of the
public APIs defined in v23.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudVMPublicAddress

func CloudVMPublicAddress() *net.IPAddr

CloudVMPublicAddress returns the public IP address of the Cloud VM instance it is run from, or nil if run from anywhere else. The returned address is the public address of a 1:1 NAT tunnel to this host.

func ConfigureGlobalLoggerFromFlags

func ConfigureGlobalLoggerFromFlags() error

ConfigureGlobalLoggerFromFlags configures the global logger from command line flags. Should be called immediately after ParseFlags.

func HasPublicIP

func HasPublicIP(log logging.Logger) bool

HasPublicIP returns true if the host has at least one public IP address.

func InitCloudVM

func InitCloudVM() error

InitCloudVM initializes the CloudVM metadata.

If EnvExpectGoogleComputeEngine is set, this function returns after the initialization is done. Otherwise, the initialization is done asynchronously and future calls to CloudVMPublicAddress() will block until the initialization is complete.

Returns an error if EnvExpectGoogleComputeEngine is set and the metadata server is inaccessible.

func NewAddressChooser

func NewAddressChooser(logger logging.Logger) rpc.AddressChooser

NewAddressChooser will return the public IP of process if the process is being hosted by a cloud service provider (e.g. Google Compute Engine, Amazon EC2), and if not will be the same as IPAddressChooser.

func ParseFlags

func ParseFlags(f *flags.Flags) error

ParseFlags parses all registered flags taking into account overrides from other configuration and environment variables. It must be called by the profile and flags.RuntimeFlags() must be passed to the runtime initialization function. The profile can use or modify the flags as it pleases.

func ParseFlagsAndConfigureGlobalLogger

func ParseFlagsAndConfigureGlobalLogger(f *flags.Flags) error

ParseFlagsAndConfigurGlobalLogger calls ParseFlags and then ConfigureGlobalLoggerFromFlags.

Types

type IPAddressChooser

type IPAddressChooser struct{}

IPAddressChooser returns the preferred IP address, which is, a public IPv4 address, then any non-loopback IPv4, then a public IPv6 address and finally any non-loopback/link-local IPv6

func (IPAddressChooser) ChooseAddresses

func (IPAddressChooser) ChooseAddresses(network string, addrs []net.Addr) ([]net.Addr, error)

Directories

Path Synopsis
Package cloudvm provides functions to test whether the current process is running on Google Compute Engine or Amazon Web Services, and to extract settings from this environment.
Package cloudvm provides functions to test whether the current process is running on Google Compute Engine or Amazon Web Services, and to extract settings from this environment.
lib
Package naming provides an implementation of the interfaces in v.io/v23/naming.
Package naming provides an implementation of the interfaces in v.io/v23/naming.
rpc
testing
Package vtrace implements the Trace and Span interfaces in v.io/v23/vtrace.
Package vtrace implements the Trace and Span interfaces in v.io/v23/vtrace.

Jump to

Keyboard shortcuts

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