env

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Timeout         time.Duration `split_words:"true" default:"3s"`
	IdleConnTimeout time.Duration `split_words:"true" default:"60s"`
	MaxIdleConns    int           `split_words:"true" default:"30"`
}

ClientConfig for Google Cloud Storage

func (ClientConfig) BasicTLSClient

func (c ClientConfig) BasicTLSClient() (*http.Client, error)

BasicTLSClient sets up TLS, default application credentials, and timeouts.

type Config

type Config struct {
	LogLevel    string `split_words:"true" default:"debug"`
	LogFile     string `split_words:"true"`
	BucketName  string `split_words:"true" required:"true"`
	KmsMkekURI  string `split_words:"true" required:"true"`
	DekPathName string `split_words:"true" required:"true"`
	AAD         string `split_words:"true" required:"true"`
	Client      ClientConfig
	Proxy       ProxyConfig
}

Config environment variables used by envconfig

func Get

func Get() (Config, error)

Get loads the configuration from environment variables.

func (Config) Logger

func (c Config) Logger() *logrus.Logger

Logger configures logging based on env variables

type ProxyConfig

type ProxyConfig struct {
	Listen          string        `default:":8080"`
	Timeout         time.Duration `split_words:"true" default:"10s"`
	CertFilePath    string        `split_words:"true" required:"true"`
	CertKeyFilePath string        `split_words:"true" required:"true"`
}

ProxyConfig contains configuration for the proxy mode.

Jump to

Keyboard shortcuts

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