env

package module
v0.0.0-...-0ee79ab Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

cloud-env

Go package-helper allows to:

  • handle UTF-8 environment variables, used by openstack CLI in non UTF-8 Windows console.
  • handle OS_AUTH_TOKEN environment variable to build the gophercloud.AuthOptions struct.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthOptionsFromEnv

func AuthOptionsFromEnv() (gophercloud.AuthOptions, error)

AuthOptionsFromEnv fills out an identity.AuthOptions structure with the settings found on the various OpenStack OS_* environment variables.

The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD and OS_PROJECT_ID.

Of these, OS_USERNAME, OS_PASSWORD, and OS_AUTH_URL must have settings, or an error will result. OS_PROJECT_ID, is optional.

OS_TENANT_ID and OS_TENANT_NAME are deprecated forms of OS_PROJECT_ID and OS_PROJECT_NAME and the latter are expected against a v3 auth api.

If OS_PROJECT_ID and OS_PROJECT_NAME are set, they will still be referred as "tenant" in Gophercloud.

If OS_PROJECT_NAME is set, it requires OS_PROJECT_ID to be set as well to handle projects not on the default domain.

To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then:

opts, err := AuthOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(opts)

func Get

func Get(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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