Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAPIConfig(urlPattern, location string, dboBackendConfig config.DubboBackendConfig, ...) router.API
- func GetAPIPattern(bkConfig config.DubboBackendConfig) string
- func GetRouter() model.Router
- func ParseDubboString(urlString string) (config.DubboBackendConfig, []string, string, error)
- func SetRegistry(name string, ...)
- func TransferURL2Api(url *common.URL, clusterName string) []config.IntegrationRequest
- type Listener
- type RegisteredType
- type Registry
Constants ¶
const ( RegisteredTypeApplication RegisteredType = iota RegisteredTypeInterface RegisteredTypeApplicationName = "application" RegisteredTypeInterfaceName = "interface" )
Variables ¶
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 ParseDubboString ¶
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®istry.role=3&release=dubbo-golang-1.5.6 &service.filter=echo,token,accesslog,tps,generic_service,execute,pshutdown&side=provider&ssl-enabled=false×tamp=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