Documentation ¶
Index ¶
Constants ¶
View Source
const ( EtcdDefaultNode = "http://127.0.0.1:2379" EtcdDefaultConfigPrefix = "/KitexConfig" EtcdDefaultTimeout = 5 * time.Second EtcdClientDefaultPath = "/{{.ClientServiceName}}/{{.ServerServiceName}}" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigParser ¶
type ConfigParser interface {
Decode(data []byte, config *EtcdConfig) error
}
type Connection ¶
type Connection struct { Method string `mapstructure:"Method"` LongConnection IdleConfig `mapstructure:"LongConnection"` MuxConnection MuxConnection `mapstructure:"MuxConnection"` }
type EndpointBasicInfo ¶
type EtcdClientSuite ¶
type EtcdClientSuite struct {
// contains filtered or unexported fields
}
func (*EtcdClientSuite) Options ¶
func (s *EtcdClientSuite) Options() []client.Option
Options return a list client.Option
type EtcdConfig ¶
type EtcdConfig struct { ClientBasicInfo *EndpointBasicInfo `mapstructure:"ClientBasicInfo"` HostPorts []string `mapstructure:"HostPorts"` DestService *string `mapstructure:"DestService"` Protocol *string `mapstructure:"Protocol"` Connection *Connection `mapstructure:"Connection"` MyConfig Config `mapstructure:"MyConfig"` }
func (*EtcdConfig) String ¶
func (c *EtcdConfig) String() string
type EtcdLoader ¶
type EtcdLoader struct { ClientServiceName string ServerServiceName string // contains filtered or unexported fields }
func NewLoader ¶
func NewLoader(clientServiceName, serverServiceName string, reader *EtcdReader, myTranslators ...Translator) (*EtcdLoader, error)
func (*EtcdLoader) GetSuite ¶
func (l *EtcdLoader) GetSuite() *EtcdClientSuite
func (*EtcdLoader) Load ¶
func (l *EtcdLoader) Load() error
type EtcdReader ¶
type EtcdReader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(opts ReaderOptions) (*EtcdReader, error)
func (*EtcdReader) GetConfig ¶
func (r *EtcdReader) GetConfig() (*EtcdConfig, error)
func (*EtcdReader) ReadToConfig ¶
func (r *EtcdReader) ReadToConfig(p *Path) error
func (*EtcdReader) SetDecoder ¶
func (r *EtcdReader) SetDecoder(decoder ConfigParser) error
type IdleConfig ¶
type Loader ¶
type Loader interface { Load() error GetSuite() EtcdClientSuite }
type MuxConnection ¶
type MuxConnection struct {
ConnNum int `mapstructure:"ConnNum"`
}
type Reader ¶
type Reader interface { SetDecoder(decoder ConfigParser) error ReadToConfig(p *Path) error GetConfig() (*EtcdConfig, error) }
type ReaderOptions ¶
type ReaderOptions struct { Node []string Prefix string PathFormat string Timeout time.Duration ConfigParser ConfigParser MyConfig Config }
Options etcd config options. All the fields have default value.
type Translator ¶
type Translator func(config *EtcdConfig) ([]kitexclient.Option, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.