types

package
v0.0.0-...-a1b4a84 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SELECTOR_RANDOM = "RANDOM"

	STORAGE_LOCAL = "LOCAL"
	STORAGE_ETCD  = "ETCD"
)

Variables

View Source
var (
	ErrFuncNotFound = errors.New("func not found")
	ErrNodeNotFound = errors.New("node not found")
)

Functions

This section is empty.

Types

type Node

type Node struct {
	Scheme   string
	Host     string // host or host:port
	FuncName string
	Metadata any
}

func NewNode

func NewNode(scheme, host, funcName string, metadata any) *Node

func (Node) Bytes

func (n Node) Bytes() []byte

func (Node) GetValueKey

func (n Node) GetValueKey() string

func (Node) String

func (n Node) String() string

func (Node) URL

func (n Node) URL() *url.URL

type ResolverOption

type ResolverOption struct {
	StorageOption  *StorageOption  `yaml:"storage" mapstructure:"storage"`
	SelectorOption *SelectorOption `yaml:"selector" mapstructure:"selector"`
}

type SelectorOption

type SelectorOption struct {
	Strategy string `yaml:"strategy" mapstructure:"strategy"`
}

type StorageOption

type StorageOption struct {
	Strategy string `yaml:"strategy" mapstructure:"strategy"`

	RpcEndpoints []string      `yaml:"endpoints" mapstructure:"endpoints"`
	DialTimeout  time.Duration `yaml:"dial_timeout" mapstructure:"dial_timeout"`

	DBPath string `yaml:"db_path" mapstructure:"db_path"`
}

type UnRegisterCallback

type UnRegisterCallback func(ctx context.Context, funcName string, node *Node) error

Jump to

Keyboard shortcuts

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