config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTLS added in v0.7.0

func NewTLS(config TLS, opts ...TLSOption) (*tls.Config, error)

NewTLS will create a tls.Config given the config and options. This will return an error if there is a problem loading the required certificate files. If the WithMTLS option is specified, a client CA cert is required.

Types

type Env

type Env map[string]string

func (Env) Set

func (e Env) Set()

func (Env) Unset

func (e Env) Unset()

type Option added in v0.1.1

type Option interface {
	Apply(*Options)
}

Option provides options when collecting configuration information.

func WithPrefix added in v0.1.1

func WithPrefix(prefix string) Option

WithPrefix adds a prefix to the name of the enviroment variables being referenced.

type Options added in v0.1.1

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

func (*Options) Prefix added in v0.1.1

func (o *Options) Prefix() string

type TLS added in v0.7.0

type TLS interface {
	// Cert returns the file name of the PEM encoded public key.
	Cert() string

	// Key returns the file name of the PEM encoded private key.
	Key() string

	// CACert returns the file name of the PEM encoded public key of the client CA.
	CACert() string
}

TLS contains the information necessary to create a tls.Config.

type TLSOption added in v0.7.0

type TLSOption interface {
	// contains filtered or unexported methods
}

TLSOption provides options for configuring the creation of a tls.Config.

func WithMTLS added in v0.7.0

func WithMTLS() TLSOption

WithMTLS will setup the tls.Config to require and verify client connections.

Directories

Path Synopsis
Package mockconfig is a generated GoMock package.
Package mockconfig is a generated GoMock package.

Jump to

Keyboard shortcuts

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