registry

package
v1.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisteredTypeApplication RegisteredType = iota
	RegisteredTypeInterface

	RegisteredTypeApplicationName = "application"
	RegisteredTypeInterfaceName   = "interface"
)

Variables

View Source
var RegisteredTypes = []string{"application", "interface"}

Functions

func CreateAPIConfig

func CreateAPIConfig(urlPattern, location string, dboBackendConfig config.DubboBackendConfig, methodString string, mappingParams []config.MappingParam) router.API

CreateAPIConfig returns router.API struct base on the input

func GetAPIPattern

func GetAPIPattern(bkConfig config.DubboBackendConfig) string

GetAPIPattern generate the API path pattern. /application/interface/version

func GetRouter

func GetRouter() model.Router

func ParseDubboString

func ParseDubboString(urlString string) (config.DubboBackendConfig, []string, string, error)

ParseDubboString parse the dubbo urls dubbo://192.168.3.46:20002/org.apache.dubbo.UserProvider2?anyhost=true&app.version=0.0.1&application=UserInfoServer&bean.name=UserProvider &cluster=failover&environment=dev&export=true&interface=org.apache.dubbo.UserProvider2&ip=192.168.3.46&loadbalance=random&message_size=4 &methods=GetUser&methods.GetUser.loadbalance=random&methods.GetUser.retries=1&methods.GetUser.weight=0&module=dubbo-go user-info server &name=UserInfoServer&organization=dubbo.io&pid=11037&registry.role=3&release=dubbo-golang-1.5.6 &service.filter=echo,token,accesslog,tps,generic_service,execute,pshutdown&side=provider&ssl-enabled=false&timestamp=1624716984&warmup=100

func SetRegistry

func SetRegistry(name string, newRegFunc func(model.Registry, common2.RegistryEventListener) (Registry, error))

SetRegistry will store the registry by name

func TransferURL2Api

func TransferURL2Api(url *common.URL, clusterName string) []config.IntegrationRequest

TransferURL2Api transfer url and clusterName to IntegrationRequest

Types

type Listener

type Listener interface {
	// Close closes this listener
	Close()
	// WatchAndHandle watch the target path and handle the event
	WatchAndHandle()
}

Listener this interface defined for load services from different kinds registry, such as nacos,consul,zookeeper.

type RegisteredType

type RegisteredType int8

func RegisterTypeFromName

func RegisterTypeFromName(name string) RegisteredType

func (*RegisteredType) String

func (t *RegisteredType) String() string

type Registry

type Registry interface {
	// Subscribe monitors the target registry.
	Subscribe() error
	// Unsubscribe stops monitoring the target registry.
	Unsubscribe() error
}

Registry interface defines the basic features of a registry

func GetRegistry

func GetRegistry(name string, regConfig model.Registry, listener common2.RegistryEventListener) (Registry, error)

GetRegistry will return the registry if not found, it will panic

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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