runenv

package
v0.11.29 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// LocalEnv represents local environment.
	LocalEnv = Env("local")
	// DevEnv represents development environment.
	DevEnv = Env("dev")
	// TestEnv represents test environment.
	TestEnv = Env("test")
	// ProdEnv represents production environment.
	ProdEnv = Env("prod")
)

Variables

This section is empty.

Functions

func AvailabilityZone

func AvailabilityZone() (string, error)

AvailabilityZone return the name of runtime availability zone. It returns empty string with erro if it cannot determine the name.

func Datacenter

func Datacenter() (string, error)

Datacenter returns the name of runtime datacenter. It returns empty string with error if it cannot determine the name.

func ExecutorID

func ExecutorID() (string, error)

ExecutorID returns mesos executor ID. It returns empty string with error if it cannot determine the ID.

func Hostname

func Hostname() (string, error)

Hostname returns the host name reported by Mesos, cloud or operating system.

func IP

func IP() net.IP

IP returns the IP of runtime host.

func MarathonAppID

func MarathonAppID() (string, error)

MarathonAppID returns ID of Marathon application in which context the process is running. It returns empty string with error if it cannot determine the ID.

func MesosAgentEndpoint

func MesosAgentEndpoint() (string, error)

MesosAgentEndpoint returns Mesos Agent endpoint. It returns empty string with error if it cannot determine Agent endpoint.

func OsHostname

func OsHostname() (string, error)

OsHostname returns result of calling hostname -f command, resorting to golang's os package if necessary

func Region

func Region() (string, error)

Region returns the name of runtime cloud region. It returns empty string with error if it cannot determine the name.

func TaskID

func TaskID() (string, error)

TaskID returns mesos task ID. It returns empty string with error if it cannot determine the ID.

Types

type Env

type Env string

Env is name of the environment on which service is running.

func Environment

func Environment() (Env, error)

Environment returns current environment based on hostname. If it cannot determine the hostname it returns an error.

Jump to

Keyboard shortcuts

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