pkg

package
v0.0.0-...-f1f8658 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxMessageSize = 2 * 1024 * 1024
)

Functions

func EnsureEtcd

func EnsureEtcd(etcdp **clientv3.Client) error

EnsureEtcd Make sure we always have an etcd connection

func EtcdClient

func EtcdClient() (*clientv3.Client, error)

EtcdClient read the specific configuration files to initiate etcd connection

func EtcdConnect

func EtcdConnect() (*clientv3.Client, error)

EtcdConnect Try to get a etcd client- assumption EtcdClient is async until used

func ReadENVSettings

func ReadENVSettings(config *ServicesConfig) error

func SetEtcdConfig

func SetEtcdConfig(cfg *ServiceConfig)

SetEtcdConfig sets the global etcd configuration settings

func SetEtcdSettings

func SetEtcdSettings(config *ServicesConfig) (*stor.Config, error)

func WithEtcd

func WithEtcd(f func(*clientv3.Client) error) error

WithEtcd executes a function against an etcd client with a managed connection lifetime.

func WithMinEtcd

func WithMinEtcd(f func(*clientv3.Client) (interface{}, error)) (interface{}, error)

WithMinEtcd executes a function against an etcd client with a managed connection lifetime.

Types

type ClickFile

type ClickFile struct {
	Interfaces []*ClickSettings `yaml:interfaces",omitempty"`
}

type ClickSettings

type ClickSettings struct {
	Host      string `yaml:host",omitempty"`
	Interface string `yaml:interface",omitempty"`
	Config    string `yaml:config",omitempty"`
}

func LoadClickConfig

func LoadClickConfig(configPath string) ([]*ClickSettings, error)

type ServiceConfig

type ServiceConfig struct {
	Address string          `yaml:address",omitempty"`
	Port    int             `yaml:port",omitempty"`
	TLS     *stor.TLSConfig `yaml:tls",omitempty"`
	Timeout int             `yaml:timeout",omitempty"`
}

ServiceConfig encapsulates information for communicating with services.

func (*ServiceConfig) Endpoint

func (s *ServiceConfig) Endpoint() string

Endpoint returns the endpoint string of a service config.

type ServicesConfig

type ServicesConfig struct {
	Etcd *ServiceConfig `yaml:",omitempty"`
}

ServicesConfig encapsulates information for communicating with services.

func LoadConfig

func LoadConfig(configPath string) (*ServicesConfig, error)

Jump to

Keyboard shortcuts

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