tuner

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 11 Imported by: 0

README

tuner

Simple package for config manipulations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Read(target interface{}) error
}

func NewEnvTuner

func NewEnvTuner() Reader

func NewFileTuner

func NewFileTuner(path string) (Reader, error)

func NewVaultTuner

func NewVaultTuner(vaultCfg VaultConfig) (Reader, error)

type TLSConfig

type TLSConfig struct {
	CACert        string `json:"ca_cert" yaml:"ca_cert"`
	CAPath        string `json:"ca_path" yaml:"ca_path"`
	ClientCert    string `json:"client_cert" yaml:"client_cert"`
	ClientKey     string `json:"client_key" yaml:"client_key" `
	TLSServerName string `json:"tls_server_name" yaml:"tls_server_name"`
	Insecure      bool   `json:"insecure" yaml:"insecure"`
}

type Tuner

type Tuner interface {
	Reader
	FromVault(vaultCfg VaultConfig) error
	FromEnv()
	FromFile(path string) error
}

func NewTuner

func NewTuner() Tuner

type VaultConfig

type VaultConfig struct {
	*TLSConfig
	Address *string        `json:"address" yaml:"address"`
	Timeout *time.Duration `json:"timeout" yaml:"timeout"`

	Path  string `json:"path" yaml:"path"`
	Token string `json:"token" yaml:"token"`
}

VaultConfig is used to read secrets from Vault into given struct

Jump to

Keyboard shortcuts

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