Documentation
¶
Index ¶
- Variables
- func EnsureEtcd(etcdp **clientv3.Client) error
- func EtcdClient() (*clientv3.Client, error)
- func EtcdConnect() (*clientv3.Client, error)
- func ReadENVSettings(config *ServicesConfig) error
- func SetEtcdConfig(cfg *ServiceConfig)
- func SetEtcdSettings(config *ServicesConfig) (*stor.Config, error)
- func WithEtcd(f func(*clientv3.Client) error) error
- func WithMinEtcd(f func(*clientv3.Client) (interface{}, error)) (interface{}, error)
- type ClickFile
- type ClickSettings
- type ServiceConfig
- type ServicesConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MaxMessageSize = 2 * 1024 * 1024
)
Functions ¶
func EnsureEtcd ¶
EnsureEtcd Make sure we always have an etcd connection
func EtcdClient ¶
EtcdClient read the specific configuration files to initiate etcd connection
func EtcdConnect ¶
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)
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)
Click to show internal directories.
Click to hide internal directories.