discovery

package
v0.0.50-alpha.127 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 6 modules, 17 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("discovery data not supported")

Functions

This section is empty.

Types

type Conn

type Conn interface {
	GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error)
	GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error)
	IsSelfNode(cc grpc.ClientConnInterface) bool
}

type KeyValue

type KeyValue interface {
	SetKey(ctx context.Context, key string, value []byte) error
	SetWithLease(ctx context.Context, key string, val []byte, ttl int64) error
	GetKey(ctx context.Context, key string) ([]byte, error)
	GetKeyWithPrefix(ctx context.Context, key string) ([][]byte, error)
	WatchKey(ctx context.Context, key string, fn WatchKeyHandler) error
}

type SvcDiscoveryRegistry

type SvcDiscoveryRegistry interface {
	Conn
	KeyValue
	AddOption(opts ...grpc.DialOption)
	Register(ctx context.Context, serviceName, host string, port int, opts ...grpc.DialOption) error
	Close()
}

type WatchKey

type WatchKey struct {
	Key   []byte
	Value []byte
	Type  WatchType
}

type WatchKeyHandler

type WatchKeyHandler func(data *WatchKey) error

type WatchType

type WatchType int
const (
	WatchTypePut    WatchType = 0
	WatchTypeDelete WatchType = 1
)

func (WatchType) String

func (t WatchType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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