registry

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 89

Documentation

Overview

Package registry is the API definition of service registry. Developers can implement the interface to extend Registry, like zookeeper, consul. Use the registry extension through server.WithRegistry(registry).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// ServiceName will be set in kitex by default
	ServiceName string
	// Addr will be set in kitex by default
	Addr net.Addr
	// PayloadCodec will be set in kitex by default, like thrift, protobuf
	PayloadCodec string

	Weight    int
	StartTime time.Time
	WarmUp    time.Duration

	// extend other infos with Tags.
	Tags map[string]string
}

Info is used for registry. The fields are just suggested, which is used depends on design.

type Registry

type Registry interface {
	Register(info *Info) error
	Deregister(info *Info) error
}

Registry is extension interface of service registry.

var NoopRegistry Registry = &noopRegistry{}

NoopRegistry is an empty implement of Registry

Jump to

Keyboard shortcuts

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