common

package
v1.4.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CONSUMER ...
	CONSUMER = iota
	// CONFIGURATOR ...
	CONFIGURATOR
	// ROUTER ...
	ROUTER
	// PROVIDER ...
	PROVIDER
)

role constant

View Source
const (
	// METHOD_MAPPER ...
	METHOD_MAPPER = "MethodMapper"
)

for lowercase func

func MethodMapper() map[string][string] {
    return map[string][string]{}
}

Variables

View Source
var (
	// DubboNodes ...
	DubboNodes = [...]string{"consumers", "configurators", "routers", "providers"}
	// DubboRole Dubbo service role
	DubboRole = [...]string{"consumer", "", "routers", "provider"}
)
View Source
var (

	// ServiceMap ...
	// todo: lowerecas?
	ServiceMap = &serviceMap{
		serviceMap: make(map[string]map[string]*Service),
	}
)

Functions

func WithIp

func WithIp(ip string) option

WithIp ...

func WithLocation

func WithLocation(location string) option

WithLocation ...

func WithMethods

func WithMethods(methods []string) option

WithMethods ...

func WithParams

func WithParams(params url.Values) option

WithParams ...

func WithParamsValue

func WithParamsValue(key, val string) option

WithParamsValue ...

func WithPassword

func WithPassword(pwd string) option

WithPassword ...

func WithPath

func WithPath(path string) option

WithPath ...

func WithPort

func WithPort(port string) option

WithPort ...

func WithProtocol

func WithProtocol(proto string) option

WithProtocol ...

func WithToken

func WithToken(token string) option

WithToken ...

func WithUsername

func WithUsername(username string) option

WithUsername ...

Types

type AsyncCallback

type AsyncCallback func(response CallbackResponse)

AsyncCallback async callback method

type AsyncCallbackService

type AsyncCallbackService interface {
	// Callback: callback
	CallBack(response CallbackResponse)
}

AsyncCallbackService callback interface for async

type CallbackResponse

type CallbackResponse interface{}

CallbackResponse for different protocol

type MethodType

type MethodType struct {
	// contains filtered or unexported fields
}

MethodType ...

func (*MethodType) ArgsType

func (m *MethodType) ArgsType() []reflect.Type

ArgsType ...

func (*MethodType) CtxType

func (m *MethodType) CtxType() reflect.Type

CtxType ...

func (*MethodType) Method

func (m *MethodType) Method() reflect.Method

Method ...

func (*MethodType) ReplyType

func (m *MethodType) ReplyType() reflect.Type

ReplyType ...

func (*MethodType) SuiteContext

func (m *MethodType) SuiteContext(ctx context.Context) reflect.Value

SuiteContext ...

type Node

type Node interface {
	GetUrl() URL
	IsAvailable() bool
	Destroy()
}

Node ...

type RPCService

type RPCService interface {
	// Reference:
	// rpc service id or reference id
	Reference() string
}

RPCService rpc service interface

type RoleType

type RoleType int

RoleType ...

func (RoleType) Role

func (t RoleType) Role() string

Role ...

func (RoleType) String

func (t RoleType) String() string

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service ...

func (*Service) Method

func (s *Service) Method() map[string]*MethodType

Method ...

func (*Service) Rcvr

func (s *Service) Rcvr() reflect.Value

Rcvr ...

func (*Service) RcvrType

func (s *Service) RcvrType() reflect.Type

RcvrType ...

type URL

type URL struct {
	Path     string // like  /com.ikurento.dubbo.UserProvider3
	Username string
	Password string
	Methods  []string
	//special for registry
	SubURL *URL
	// contains filtered or unexported fields
}

URL ...

func MergeUrl

func MergeUrl(serviceUrl *URL, referenceUrl *URL) *URL

MergeUrl ...

func NewURL

func NewURL(urlString string, opts ...option) (URL, error)

NewURL will create a new url the urlString should not be empty

func NewURLWithOptions

func NewURLWithOptions(opts ...option) *URL

NewURLWithOptions ...

func (*URL) AddParam

func (c *URL) AddParam(key string, value string)

AddParam ...

func (*URL) Clone

func (c *URL) Clone() *URL

Clone ...

func (*URL) ColonSeparatedKey

func (c *URL) ColonSeparatedKey() string

ColonSeparatedKey The format is "{interface}:[version]:[group]"

func (*URL) EncodedServiceKey

func (c *URL) EncodedServiceKey() string

EncodedServiceKey ...

func (URL) GetMethodParam

func (c URL) GetMethodParam(method string, key string, d string) string

GetMethodParam ...

func (URL) GetMethodParamBool

func (c URL) GetMethodParamBool(method string, key string, d bool) bool

GetMethodParamBool ...

func (URL) GetMethodParamInt

func (c URL) GetMethodParamInt(method string, key string, d int64) int64

GetMethodParamInt ...

func (URL) GetMethodParamInt64

func (c URL) GetMethodParamInt64(method string, key string, d int64) int64

GetMethodParamInt64 ...

func (URL) GetParam

func (c URL) GetParam(s string, d string) string

GetParam ...

func (URL) GetParamAndDecoded

func (c URL) GetParamAndDecoded(key string) (string, error)

GetParamAndDecoded ...

func (URL) GetParamBool

func (c URL) GetParamBool(s string, d bool) bool

GetParamBool ...

func (URL) GetParamInt

func (c URL) GetParamInt(s string, d int64) int64

GetParamInt ...

func (URL) GetParams

func (c URL) GetParams() url.Values

GetParams ...

func (URL) GetRawParam

func (c URL) GetRawParam(key string) string

GetRawParam ...

func (URL) Key

func (c URL) Key() string

Key ...

func (*URL) RangeParams

func (c *URL) RangeParams(f func(key, value string) bool)

RangeParams ...

func (*URL) RemoveParams

func (c *URL) RemoveParams(set *gxset.HashSet)

RemoveParams ...

func (URL) Service

func (c URL) Service() string

Service ...

func (URL) ServiceKey

func (c URL) ServiceKey() string

ServiceKey ...

func (*URL) SetParam

func (c *URL) SetParam(key string, value string)

SetParam ...

func (*URL) SetParams

func (c *URL) SetParams(m url.Values)

SetParams ...

func (URL) String

func (c URL) String() string

func (URL) ToMap

func (c URL) ToMap() map[string]string

ToMap transfer URL to Map

func (URL) URLEqual

func (c URL) URLEqual(url URL) bool

URLEqual ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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