registry

package
v0.0.0-...-e43fadc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close 关闭注册中心的服务

func Join

func Join(elem ...string) string

Join 地址连接

func Register

func Register(name string, resolver RegistryResolver)

Register 注册配置文件适配器

func ResolveAddress

func ResolveAddress(address string) (proto string, raddr []string, u string, p string, err error)

ResolveAddress 解析地址 如:zk://192.168.0.155:2181 如:standalone://localhost

Types

type IRegistry

type IRegistry interface {
	Exists(path string) (bool, error)
	CanWirteDataInDir() bool
	WatchChildren(path string) (data chan registry.ChildrenWatcher, err error)
	WatchValue(path string) (data chan registry.ValueWatcher, err error)
	GetChildren(path string) (paths []string, version int32, err error)
	GetValue(path string) (data []byte, version int32, err error)
	CreatePersistentNode(path string, data string) (err error)
	CreateTempNode(path string, data string) (err error)
	CreateSeqNode(path string, data string) (rpath string, err error)
	Update(path string, data string, version int32) (err error)
	Delete(path string) error
	GetSeparator() string
	Close() error
}

IRegistry 注册中心接口,通过扩展支持zookeeper,consul,etcd

func NewRegistryWithAddress

func NewRegistryWithAddress(address string, log logger.ILogging) (r IRegistry, err error)

NewRegistryWithAddress 根据协议地址创建注册中心

type RegistryResolver

type RegistryResolver interface {
	Resolve(servers []string, u string, p string, log logger.ILogging) (IRegistry, error)
}

RegistryResolver 定义配置文件转换方法

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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