vaulttoenvs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VaultAddr string

	Debug            bool
	SecretConfig     string
	SecretConfigFile string
	// contains filtered or unexported fields
}

Config contains the vault-to-env configuration

type Logger

type Logger interface {
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Fatal(args ...interface{})
}

Logger is a log interface for passing custom loggers

type SecretItem

type SecretItem struct {
	SecretPath string            `json:"vault_path" yaml:"secretPath"`
	TTL        int               `json:"ttl" yaml:"ttl"`
	Version    float64           `json:"version" yaml:"version"`
	SecretMaps map[string]string `json:"set" yaml:"set"`
	// contains filtered or unexported fields
}

SecretItem holds data about a secret config

type VaultToEnvs

type VaultToEnvs struct {
	// contains filtered or unexported fields
}

VaultToEnvs is the main struct for this package

func NewVaultToEnvs

func NewVaultToEnvs(config *Config) *VaultToEnvs

NewVaultToEnvs creates a new VaultToEnvs

func (*VaultToEnvs) DisplayEnvExports

func (v *VaultToEnvs) DisplayEnvExports() error

DisplayEnvExports outputs the results to stdout

func (*VaultToEnvs) GetKV2Secret

func (v *VaultToEnvs) GetKV2Secret(secretItem *SecretItem) error

GetKV2Secret gets a key-value (version 2) secret Uses the `version` option to select the desired version. This can be negative to go back x versions or positive to indicate the actual secret version

func (*VaultToEnvs) SetLogger

func (v *VaultToEnvs) SetLogger(logger Logger)

SetLogger allows a custom logger to be used for messages

func (*VaultToEnvs) SetVaultToken

func (v *VaultToEnvs) SetVaultToken(token string)

SetVaultToken sets the Vault token

Jump to

Keyboard shortcuts

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