config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Host string `mapstructure:"host"`
	Port uint64 `mapstructure:"port,omitempty"`
}

Connection is a configuration of an etcd host and port

func (*Connection) Verify

func (c *Connection) Verify() error

type EtcdConfig

type EtcdConfig struct {
	Connections           []Connection `mapstructure:"connections"`
	Protocol              EtcdProtocol `mapstructure:"protocol,omitempty"`
	User                  string       `mapstructure:"user,omitempty"`
	Password              string       `mapstructure:"password,omitempty"`
	RequestTimeoutSeconds uint64       `mapstructure:"request_timeout"`
}

EtcdConfig defines the way to configure the connection to the etcd database

func (*EtcdConfig) BuildEndpoints

func (c *EtcdConfig) BuildEndpoints() []string

BuildEndpoints returns a slice of URLs that can be used in the method clientv3.New

func (*EtcdConfig) Verify

func (c *EtcdConfig) Verify() error

type EtcdProtocol

type EtcdProtocol string
const (
	EtcdAsHTTPProtocol  EtcdProtocol = "http"
	EtcdAsHTTPSProtocol EtcdProtocol = "https"
)

func (*EtcdProtocol) Verify

func (c *EtcdProtocol) Verify() error

type Resolver

type Resolver interface {
	SetEnvPrefix(prefix string) Resolver
	SetConfigFile(filename string) Resolver
	Resolve(config interface{}) Validator
}

func NewResolver

func NewResolver() Resolver

type Validator

type Validator interface {
	Verify() error
}

Jump to

Keyboard shortcuts

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