common

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 19 Imported by: 37

Documentation

Index

Constants

View Source
const (
	CONSUMER = iota
	CONFIGURATOR
	ROUTER
	PROVIDER
)
View Source
const METHOD_MAPPER = "MethodMapper"

for lowercase func

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

Variables

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

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

Functions

func WithIp

func WithIp(ip string) option

func WithLocation added in v1.2.0

func WithLocation(location string) option

func WithMethods

func WithMethods(methods []string) option

func WithParams

func WithParams(params url.Values) option

func WithParamsValue

func WithParamsValue(key, val string) option

func WithPassword

func WithPassword(pwd string) option

func WithPath

func WithPath(path string) option

func WithPort

func WithPort(port string) option

func WithProtocol

func WithProtocol(proto string) option

func WithToken added in v1.2.0

func WithToken(token string) option

func WithUsername

func WithUsername(username string) option

Types

type AsyncCallback added in v1.3.0

type AsyncCallback func(response CallbackResponse)

AsyncCallback async callback method

type AsyncCallbackService added in v1.3.0

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

AsyncCallbackService callback interface for async

type CallbackResponse added in v1.3.0

type CallbackResponse interface {
}

CallbackResponse for different protocol

type MethodType

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

func (*MethodType) ArgsType

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

func (*MethodType) CtxType

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

func (*MethodType) Method

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

func (*MethodType) ReplyType

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

func (*MethodType) SuiteContext

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

type Node

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

type RPCService

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

rpc service interface

type RoleType

type RoleType int

func (RoleType) Role

func (t RoleType) Role() string

func (RoleType) String

func (t RoleType) String() string

type Service

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

func (*Service) Method

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

func (*Service) Rcvr

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

func (*Service) RcvrType

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

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
}

func MergeUrl

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

func NewURL

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

func NewURLWithOptions

func NewURLWithOptions(opts ...option) *URL

func (*URL) AddParam

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

func (*URL) Clone added in v1.2.0

func (c *URL) Clone() *URL

func (URL) Context

func (c URL) Context() context.Context

func (*URL) EncodedServiceKey added in v1.2.0

func (c *URL) EncodedServiceKey() string

func (URL) GetMethodParam

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

func (URL) GetMethodParamBool added in v1.3.0

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

func (URL) GetMethodParamInt

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

func (URL) GetMethodParamInt64

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

func (URL) GetParam

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

func (URL) GetParamAndDecoded

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

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

func (URL) GetParams added in v1.2.0

func (c URL) GetParams() url.Values

func (URL) GetRawParam

func (c URL) GetRawParam(key string) string

func (URL) Key

func (c URL) Key() string

func (*URL) RangeParams added in v1.2.0

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

func (*URL) RemoveParams added in v1.2.0

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

func (URL) Service

func (c URL) Service() string

func (URL) ServiceKey

func (c URL) ServiceKey() string

func (*URL) SetParam added in v1.2.0

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

func (*URL) SetParams added in v1.2.0

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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