resolver

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(b Builder)

Register registers the Resolver builder to the builder map. b.Name (lower-cased) will be used as the name registered with this builder.

Types

type Builder

type Builder interface {
	// Name returns the name of Resolvers built by this builder.
	Name() string
	// Build creates a new Resolver with the options.
	Build(c Client, opts data.Map) (Resolver, error)
}

Builder creates a Resolver.

func Get

func Get(name string) Builder

Get returns the resolver builder registered with the given name. Note that the compare is done in a case-insenstive fashion. If no builder is register with the name, nil will be returned.

type Client

type Client struct {
	Server  string
	Version string
	Group   string
	Codec   string
}

type Resolver

type Resolver interface {
	// Resolve tries to lookup nodes right now.
	Resolve() ([]transport.Address, error)
	// Watch register a watch to Resolver.
	Watch(notify func([]transport.Address))
	// Close stop the watch.
	Close()
}

Resolver defines interfaces for nodes discovery.

func Direct

func Direct(addrs ...transport.Address) Resolver

Directories

Path Synopsis
etcd
v2
v3

Jump to

Keyboard shortcuts

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