elector

package
v1.8.14 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstanceID

func GetInstanceID() string

GetInstanceID returns the unique instance ID

func IsLeader

func IsLeader() bool

func Start

func Start(opts ...ElectorConfig) error

func Stop

func Stop()

Types

type Elector

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

Elector handles leader election using a distributed lock

type ElectorConfig

type ElectorConfig struct {
	TableName     string
	MinDelay      time.Duration
	MaxDelay      time.Duration
	CheckInterval time.Duration
	LeaseTimeout  time.Duration
	KeyName       string
}

ElectorConfig holds configuration for the leader elector

Jump to

Keyboard shortcuts

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