leaderelection

package
v0.0.0-...-baf8ae7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	OnStartedLeading func(ctx context.Context)
	OnStoppedLeading func()
}

type Config

type Config struct {
	Identity      string
	LeaseDuration time.Duration
	RenewRate     time.Duration
	RetryRate     time.Duration
}

type KubernetesDriver

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

func NewKubernetesDriver

func NewKubernetesDriver(conf Config, clientset *kubernetes.Clientset) *KubernetesDriver

func (*KubernetesDriver) Register

func (d *KubernetesDriver) Register(ctx context.Context, key string, callbacks Callbacks)

type RedisDriver

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

func NewRedisDriver

func NewRedisDriver(conf Config, rdb redis.UniversalClient) *RedisDriver

func (*RedisDriver) Register

func (d *RedisDriver) Register(ctx context.Context, key string, callbacks Callbacks)

type Service

type Service interface {
	Register(ctx context.Context, key string, callbacks Callbacks)
}

func New

func New(connPool *supervisor.ConnPool) Service

Jump to

Keyboard shortcuts

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