etcd

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package etcd implements onexmesh registry.Registrar and registry.Discovery backed by etcd, using leases for automatic instance expiry (TTL) and prefix watch for change notifications. It serves as the reference implementation proving the registry abstraction is backend-agnostic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(opts Options) (registry.Discovery, error)

NewDiscovery creates an Etcd Discovery.

func NewRegistrar

func NewRegistrar(opts Options) (registry.Registrar, error)

NewRegistrar creates an Etcd Registrar.

Types

type Options

type Options struct {
	// Endpoints are the etcd cluster addresses, e.g. ["127.0.0.1:2379"].
	Endpoints []string
	// DialTimeout bounds the initial connection attempt.
	DialTimeout time.Duration
	// Username and Password enable basic auth, when set.
	Username string
	Password string
	// TTL is the lease TTL in seconds; instances expire if not refreshed.
	TTL int64
	// Namespace scopes the registration keys.
	Namespace string
}

Options configures the Etcd backend.

Jump to

Keyboard shortcuts

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