etcd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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