base

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NACOS string = "nacos"
	ETCD  string = "etcd"
)

Backend represents a KV Store Backend

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	GetServices() []*ServiceInstance
	WatchService() <-chan []*ServiceInstance
	Close()
}

type Registry

type Registry interface {
	Register(ctx context.Context, serviceInstance *ServiceInstance) error
	Unregister(ctx context.Context, name string) error
	UnregisterAllService(ctx context.Context) error
}

type ServiceInstance

type ServiceInstance struct {
	// ID is the unique instance ID as registered.
	ID string `json:"id"`
	// Name is the service name as registered.
	Name string `json:"name"`
	// Version is the version of the compiled.
	Version string `json:"version"`
	// Endpoint addresses of the service instance.
	Endpoint *config.Listener
}

ServiceInstance is an instance of a service in a discovery system.

func (ServiceInstance) String

func (p ServiceInstance) String() string

Jump to

Keyboard shortcuts

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