discovery

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package discovery adapts instance registries to Conduit service clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forge

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

Forge adapts an existing Forge discovery backend without owning its lifecycle.

func NewForge

func NewForge(backend func() (backends.Backend, error)) *Forge

NewForge resolves the existing backend lazily after Forge registers its services.

func (*Forge) Deregister

func (f *Forge) Deregister(ctx context.Context, identity core.Identity) error

Deregister removes only the stopping member's dedicated record.

func (*Forge) List

func (f *Forge) List(ctx context.Context, namespace string) ([]core.Instance, error)

List includes unhealthy members without mixing namespaces or legacy unscoped records.

func (*Forge) Register

func (f *Forge) Register(ctx context.Context, instance core.Instance) error

Register renews one namespaced Conduit member in the shared Forge backend.

func (*Forge) Resolve

func (f *Forge) Resolve(ctx context.Context, namespace, service string) ([]core.Instance, error)

Resolve selects only healthy members carrying the matching namespace.

type Static

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

Static is an explicitly configured registry for development and fixed deployments.

func NewStatic

func NewStatic(instances ...core.Instance) *Static

NewStatic builds a registry without network discovery.

func (*Static) Deregister

func (r *Static) Deregister(_ context.Context, identity core.Identity) error

Deregister removes only the stopping instance.

func (*Static) List

func (r *Static) List(_ context.Context, namespace string) ([]core.Instance, error)

List returns a namespace snapshot including unhealthy and draining members.

func (*Static) Register

func (r *Static) Register(_ context.Context, instance core.Instance) error

Register replaces the record for this exact instance, leaving its peers intact.

func (*Static) Resolve

func (r *Static) Resolve(ctx context.Context, namespace, service string) ([]core.Instance, error)

Resolve returns ready replicas for one service in one namespace.

Jump to

Keyboard shortcuts

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