config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigPath is the default path to the configuration file
	DefaultConfigPath = "~/.vault"

	// ConfigPathEnv is the environment variable that can be used to
	// override where the Vault configuration is.
	ConfigPathEnv = "VAULT_CONFIG_PATH"
)

Variables

This section is empty.

Functions

func DefaultTokenHelper

func DefaultTokenHelper() (token.TokenHelper, error)

DefaultTokenHelper returns the token helper that is configured for Vault.

Types

type DefaultConfig

type DefaultConfig struct {
	// TokenHelper is the executable/command that is executed for storing
	// and retrieving the authentication token for the Vault CLI. If this
	// is not specified, then vault's internal token store will be used, which
	// stores the token on disk unencrypted.
	TokenHelper string `hcl:"token_helper"`
}

Config is the CLI configuration for Vault that can be specified via a `$HOME/.vault` file which is HCL-formatted (therefore HCL or JSON).

func Config

func Config() (*DefaultConfig, error)

Config loads the configuration and returns it. If the configuration is already loaded, it is returned.

func LoadConfig

func LoadConfig(path string) (*DefaultConfig, error)

LoadConfig reads the configuration from the given path. If path is empty, then the default path will be used, or the environment variable if set.

func ParseConfig

func ParseConfig(contents string) (*DefaultConfig, error)

ParseConfig parses the given configuration as a string.

Jump to

Keyboard shortcuts

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