backends

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulConfig

type ConsulConfig struct {
	// Nodes is a list of backend nodes.
	// A connection will only be established to the first server in the list.
	Nodes []string

	// The backend URI scheme (http or https).
	Scheme string

	// A DNS server record to discover the consul nodes.
	SRVRecord SRVRecord `toml:"srv_record"`

	// The client cert file.
	ClientCert string `toml:"client_cert"`

	// The client key file.
	ClientKey string `toml:"client_key"`

	//The client CA key file.
	ClientCaKeys string `toml:"client_ca_keys"`

	template.Backend
}

ConsulConfig represents the config for the consul backend.

func (*ConsulConfig) Connect

func (c *ConsulConfig) Connect() (template.Backend, error)

Connect creates a new consulClient and fills the underlying template.Backend with the consul-Backend specific data.

type EnvConfig

type EnvConfig struct {
	template.Backend
}

EnvConfig represents the config for the env backend

func (*EnvConfig) Connect

func (c *EnvConfig) Connect() (template.Backend, error)

Connect creates a new envClient and fills the underlying template.Backend with the file-Backend specific data.

type EtcdConfig

type EtcdConfig struct {
	// Nodes is list of backend nodes.
	Nodes []string

	// The backend URI scheme (http or https).
	// This is only used when the nodes are discovered via DNS srv records and the api level is 2.
	//
	// The default is http.
	Scheme string

	// The client cert file.
	ClientCert string `toml:"client_cert"`

	// The client key file.
	ClientKey string `toml:"client_key"`

	// The client CA key file.
	ClientCaKeys string `toml:"client_ca_keys"`

	// A DNS server record to discover the etcd nodes.
	SRVRecord SRVRecord `toml:"srv_record"`

	// The username for the basic_auth authentication.
	Username string

	// The password for the basic_auth authentication.
	Password string

	// The etcd api-level to use (2 or 3).
	//
	// The default is 2.
	Version int
	template.Backend
}

EtcdConfig represents the config for the etcd backend.

func (*EtcdConfig) Connect

func (c *EtcdConfig) Connect() (template.Backend, error)

Connect creates a new etcd{2,3}Client and fills the underlying template.Backend with the etcd-Backend specific data.

type FileConfig

type FileConfig struct {
	// The filepath to a yaml or json file containing the key-value pairs.
	// This can be a local file or a remote http/https location.
	Filepath string
	template.Backend
}

FileConfig represents the config for the file backend.

func (*FileConfig) Connect

func (c *FileConfig) Connect() (template.Backend, error)

Connect creates a new fileClient and fills the underlying template.Backend with the file-Backend specific data.

type MockConfig

type MockConfig struct {
	Error error
	template.Backend
}

MockConfig represents the config for the consul backend.

func (*MockConfig) Connect

func (c *MockConfig) Connect() (template.Backend, error)

Connect creates a new mockClient

type RedisConfig

type RedisConfig struct {
	// A list of backend nodes.
	Nodes []string

	// A DNS server record to discover the redis nodes.
	SRVRecord SRVRecord `toml:"srv_record"`

	// The redis password.
	Password string

	// The redis database.
	Database int

	template.Backend
}

RedisConfig represents the config for the redis backend.

func (*RedisConfig) Connect

func (c *RedisConfig) Connect() (template.Backend, error)

Connect creates a new redisClient and fills the underlying template.Backend with the redis-Backend specific data.

type SRVRecord

type SRVRecord string

SRVRecord is a SRV-Record string for example _etcd-client._tcp.example.com.

func (SRVRecord) GetNodesFromSRV

func (r SRVRecord) GetNodesFromSRV(scheme string) ([]string, error)

GetNodesFromSRV returns the nodes stored in the record.

type VaultConfig

type VaultConfig struct {
	// The address of the vault server.
	Node string

	// The vault authentication type.
	//   (token, approle, app-id, userpass, github, cert)
	AuthType string `toml:"auth_type"`

	// The vault app ID.
	// Only used with auth_type=app-id.
	AppID string `toml:"app_id"`
	// The vault user ID.
	// Only used with auth_type=app-id.
	UserID string `toml:"user_id"`

	// The vault RoleID.
	// Only used with auth_type=approle.
	RoleID string `toml:"role_id"`
	// The vault SecretID.
	// Only used with auth_type=approle.
	SecretID string `toml:"secret_id"`

	// The username for the userpass authentication.
	Username string
	// The password for the userpass authentication.
	Password string

	// The vault authentication token. Only used with auth_type=token or github.
	AuthToken string `toml:"auth_token"`

	ClientCert   string `toml:"client_cert"`
	ClientKey    string `toml:"client_key"`
	ClientCaKeys string `toml:"client_ca_keys"`
	template.Backend
}

VaultConfig represents the config for the vault backend.

func (*VaultConfig) Connect

func (c *VaultConfig) Connect() (template.Backend, error)

Connect creates a new vaultClient and fills the underlying template.Backend with the vault-Backend specific data.

type ZookeeperConfig

type ZookeeperConfig struct {
	// A list of zookeeper nodes.
	Nodes []string

	// A DNS server record to discover the zookeeper nodes.
	SRVRecord SRVRecord `toml:"srv_record"`
	template.Backend
}

ZookeeperConfig represents the config for the consul backend.

func (*ZookeeperConfig) Connect

func (c *ZookeeperConfig) Connect() (template.Backend, error)

Connect creates a new zookeeperClient and fills the underlying template.Backend with the zookeeper-Backend specific data.

Directories

Path Synopsis
Package error describes errors in remco backends
Package error describes errors in remco backends

Jump to

Keyboard shortcuts

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