elect

package
v0.0.0-...-2b29b9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elect

type Elect struct {
	// contains filtered or unexported fields
}

func NewElect

func NewElect(config *EtcdConfig, key string) (*Elect, error)

func (*Elect) Start

func (elect *Elect) Start(ctx context.Context)

func (*Elect) Stop

func (elect *Elect) Stop()

func (*Elect) SubscribeWithAction

func (elect *Elect) SubscribeWithAction(ctx context.Context, onWin, onLost func())

type EtcdConfig

type EtcdConfig struct {
	Endpoints []string
	Username  string
	Password  string
	TLS       *tls.Config

	LockTTL    int
	LockPrefix string
	// contains filtered or unexported fields
}

func NewEtcdConfigFromDBOptions

func NewEtcdConfigFromDBOptions(opts *options.DBOptions) (*EtcdConfig, error)

Jump to

Keyboard shortcuts

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