runtime

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrefix

func BuildPrefix(info *ServiceDesc) string

func BuildRegPath

func BuildRegPath(info *ServiceDesc) string

func Exist

func Exist(l []resolver.Address, addr resolver.Address) bool

Exist helper function

func Remove

func Remove(s []resolver.Address, addr resolver.Address) ([]resolver.Address, bool)

Remove helper function

Types

type Result

type Result struct {
	Action string
	Data   interface{}
}

type ServiceDesc

type ServiceDesc struct {
	config.EndPoint
	ID       string            `json:"id"`
	Name     string            `json:"name"`
	Version  string            `json:"version"` //服务版本
	Weight   int64             `json:"weight"`  //服务权重
	Tags     []string          `json:"tags"`
	Metadata map[string]string `json:"metadata"`
}

ServiceDesc 用于表示在注册中心注册的服务实例的信息

func ParseValue

func ParseValue(value []byte) (ServiceDesc, error)

func SplitPath

func SplitPath(path string) (ServiceDesc, error)

func (*ServiceDesc) Listen

func (s *ServiceDesc) Listen() (net.Listener, error)

type Watcher

type Watcher interface {
	Next() (Result, error)
	Stop()
}

Watcher 用于监视变量的变更

Jump to

Keyboard shortcuts

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