Documentation ¶
Index ¶
- type Config
- func (c *Config) ClientURLs() types.URLs
- func (c *Config) DataDir() string
- func (c *Config) EnableLogging() bool
- func (c *Config) EndPoints() types.URLs
- func (c *Config) InitialCluster() string
- func (c *Config) LogDir() string
- func (c *Config) Logger() log.Logger
- func (c *Config) Name() string
- func (c *Config) PeerURLs() types.URLs
- func (c *Config) StartTimeout() time.Duration
- type Node
- func (n *Node) Client() *clientv3.Client
- func (n *Node) ClientURLs() types.URLs
- func (n *Node) ID() string
- func (n *Node) IsLeader() bool
- func (n *Node) LeaderID() string
- func (n *Node) Members() ([]*etcdserverpb.Member, error)
- func (n *Node) RemoveMember(member *etcdserverpb.Member) error
- func (n *Node) Session() *concurrency.Session
- func (n *Node) Start() error
- func (n *Node) Stop() error
- func (n *Node) UpdateMember(member *etcdserverpb.Member) error
- type Option
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config defines the embed etcd
func (*Config) ClientURLs ¶
ClientURLs returns the client URLs
func (*Config) EnableLogging ¶
func (*Config) InitialCluster ¶
InitialCluster returns the endpoints
func (*Config) StartTimeout ¶
StartTimeout returns the start timeout
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node embeds a etcd server
func (*Node) ClientURLs ¶
ClientURLs returns the list of client endpoint
func (*Node) Members ¶
func (n *Node) Members() ([]*etcdserverpb.Member, error)
Members returns the given node members
func (*Node) RemoveMember ¶
func (n *Node) RemoveMember(member *etcdserverpb.Member) error
RemoveMember removes a given member from the memberlist
func (*Node) Session ¶
func (n *Node) Session() *concurrency.Session
Session returns the etcd session used by Embed
func (*Node) UpdateMember ¶
func (n *Node) UpdateMember(member *etcdserverpb.Member) error
UpdateMember updates a given member
type Option ¶
type Option interface { // Apply sets the Option value of a config. Apply(config *Config) }
Option is the interface that applies a configuration option.
func WithInitialCluster ¶
WithInitialCluster sets the initial cluster
func WithStartTimeout ¶
WithStartTimeout sets the start timeout
type OptionFunc ¶
type OptionFunc func(config *Config)
OptionFunc implements the Option interface.
func (OptionFunc) Apply ¶
func (f OptionFunc) Apply(c *Config)
Click to show internal directories.
Click to hide internal directories.