discovery

package
v0.0.50-alpha.76 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupportedKeyValue = errors.New("discovery data not supported key value")

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
	GetKey(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()
	GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error)
}

type WatchKey

type WatchKey struct {
	Value []byte
}

type WatchKeyHandler

type WatchKeyHandler func(data *WatchKey) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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