resolver

package
v0.0.0-...-692e367 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResolverNotDetected = errors.New("resolver not detected")
	ErrNotAvailable        = errors.New("not available")
)

Functions

func Filter

func Filter(routes []route.Route, opts LookupOptions) []route.Route

Types

type LookupOption

type LookupOption func(*LookupOptions)

type LookupOptions

type LookupOptions struct {
	Address string
}

func NewLookup

func NewLookup(opts ...LookupOption) LookupOptions

type Option

type Option func(*Options)

type Options

type Options struct {
	Cache    bool
	Endpoint string
}

func DefaultOptions

func DefaultOptions() Options

type ResolveType

type ResolveType string
const (
	LocalResolver  ResolveType = "local"
	ConsulResolver ResolveType = "consul"
)

func (ResolveType) String

func (r ResolveType) String() string

type Resolver

type Resolver interface {
	OnStart(ctx context.Context) error
	Table() Table
	Lookup(service string, opts ...LookupOption) (route.List, error)
}
var (
	DefaultResolver Resolver
)

type Table

type Table interface {
	Create(route.Route) error
	Delete(route.Route) error
	Update(route.Route) error
	Find(service string) ([]route.Route, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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