registry

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: 6 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 registry builder to the registry 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 registry built by this builder.
	Name() string
	// Build creates a new Registry with the options.
	//Build(name string, opts data.Map) Registry
	Build(server Server, opts data.Map) (Registry, error)
}

Builder creates a registry.

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 Registry

type Registry interface {
	// Register send all addresses to registry and keep refreshing.
	Register()
	//Heartbeat()
	// Offline remove server addresses from registry and stop refreshing immediately.
	Offline() error
	// Online recover server registering.
	Online() error
	// Close stop the register.
	Close()
}

Registry defines interfaces for register server.

type Server

type Server struct {
	Name      string
	Version   string
	Addresses []transport.Address
	// Options is additional options need send to registry with all addresses.
	Options data.Map
}

Server holds the server information for registering.

Directories

Path Synopsis
v2
v3

Jump to

Keyboard shortcuts

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