Documentation ¶
Index ¶
- Constants
- type Config
- type Leader
- type LeaderOption
- type Plugin
- func (p *Plugin) Boot(conf interface{}, dependencies ...interface{}) plugins.Plugin
- func (p *Plugin) Close() error
- func (p *Plugin) Etcd() *clientv3.Client
- func (p *Plugin) IsEnabled() bool
- func (p *Plugin) Leader(opts ...LeaderOption) *Leader
- func (p *Plugin) Lock(key string, do func() error) error
- func (p *Plugin) LockWithContext(ctx context.Context, key string, do func() error) error
- func (p *Plugin) LockWithTTL(key string, ttl time.Duration, do func() error) error
- func (p *Plugin) Name() string
- func (p *Plugin) Start() error
Constants ¶
View Source
const Name = "etcd"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Leader ¶ added in v1.6.0
type Leader struct {
// contains filtered or unexported fields
}
func NewLeader ¶ added in v1.6.0
func NewLeader(e *clientv3.Client, l logrus.FieldLogger, serviceID string, opts ...LeaderOption) *Leader
type LeaderOption ¶ added in v1.6.0
func WithElectionKey ¶ added in v1.6.0
func WithElectionKey(key string) LeaderOption
func WithElectionPrefix ¶ added in v1.6.0
func WithElectionPrefix(prefix string) LeaderOption
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Leader ¶ added in v1.6.0
func (p *Plugin) Leader(opts ...LeaderOption) *Leader
func (*Plugin) LockWithContext ¶
func (*Plugin) LockWithTTL ¶
Click to show internal directories.
Click to hide internal directories.