dregistry

package module
v0.0.0-...-2fed395 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("registry: not found")

ErrNotFound is returned when a resolver has no endpoint for the identifier. Chain skips this error and tries the next resolver. Other errors stop the chain.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err is or wraps ErrNotFound.

func Register

func Register(scheme string, factory FactoryFunc)

Register associates a DSN scheme with a resolver factory.

Types

type Endpoint

type Endpoint struct {
	Address      string
	TLS          bool
	AuthRequired bool
}

Endpoint is a resolved foundational-store gRPC target.

type FactoryFunc

type FactoryFunc func(config string, logger *zap.Logger) (Resolver, error)

FactoryFunc constructs a Resolver from a DSN and logger.

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, identifier string) (*Endpoint, error)
}

Resolver maps an identifier to a store endpoint.

func Chain

func Chain(resolvers ...Resolver) Resolver

Chain returns a resolver that tries each resolver in order. ErrNotFound continues to the next resolver; any other error stops the chain.

func New

func New(config string, logger *zap.Logger) (Resolver, error)

New builds a Resolver from a DSN. Multiple DSNs may be comma-separated; they are tried in order and ErrNotFound falls through to the next.

Commas that sit inside a later `scheme://` token are treated as separators; commas inside inline JSON are left alone.

Directories

Path Synopsis
internal
pb

Jump to

Keyboard shortcuts

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