etcd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package etcd provides an etcd-backed coordination.Coordinator (Patroni-style leader lease).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

Coordinator implements coordination.Coordinator using an etcd leader key + lease.

func New

func New(conf *config.Config) *Coordinator

New builds an etcd coordinator from runtime config.

func (*Coordinator) AddMember

func (c *Coordinator) AddMember(ctx context.Context, id string) error

func (*Coordinator) ClusterView

func (c *Coordinator) ClusterView(ctx context.Context) (coordination.ClusterView, error)

func (*Coordinator) GetClusterConfig

func (c *Coordinator) GetClusterConfig(ctx context.Context) ([]byte, error)

func (*Coordinator) IsLeader

func (c *Coordinator) IsLeader() bool

func (*Coordinator) LocalID

func (c *Coordinator) LocalID() string

func (*Coordinator) RemoveMember

func (c *Coordinator) RemoveMember(ctx context.Context, id string) error

func (*Coordinator) SetClusterConfig

func (c *Coordinator) SetClusterConfig(ctx context.Context, cfg []byte) error

func (*Coordinator) Start

func (c *Coordinator) Start(ctx context.Context) error

func (*Coordinator) Stop

func (c *Coordinator) Stop() error

func (*Coordinator) Watch

func (c *Coordinator) Watch(ctx context.Context) (<-chan coordination.ClusterView, error)

Jump to

Keyboard shortcuts

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