Documentation ¶
Index ¶
- Constants
- Variables
- func Address() *utils.Address
- func AddressFormat(address string) string
- func AddressPrefix() string
- func Discovery() (client.ServiceDiscovery, error)
- func Equal(src, tar any) bool
- func EqualSliceString(v1, v2 []string) bool
- func LocalIpv4() (ip string, err error)
- func Register(urlRpcxAddr *utils.Address) (*redis.Register, error)
- func Timeout() time.Duration
- func TypeOf(src any) reflect.Type
- type Context
- func (this *Context) Bind(i interface{}) error
- func (this *Context) Bytes() []byte
- func (this *Context) Error(err any) *values.Message
- func (this *Context) Errorf(code int, format any, args ...interface{}) *values.Message
- func (this *Context) Get(key string) interface{}
- func (this *Context) GetInt(key string) (val int)
- func (this *Context) GetInt32(key string) (val int32)
- func (this *Context) GetInt64(key string) (val int64)
- func (this *Context) GetMetadata(key string) (val string)
- func (this *Context) GetString(key string) (val string)
- func (this *Context) GetValue(key any) any
- func (this *Context) Metadata() map[string]string
- func (this *Context) Reader() io.Reader
- func (this *Context) ServiceMethod() string
- func (this *Context) ServicePath() string
- func (this *Context) SetMetadata(key, val string)
- func (this *Context) SetValue(key, val any)
- func (this *Context) Write(data []byte) error
- type Handler
- func (this *Handler) Caller(node *registry.Node, c *Context) (reply interface{}, err error)
- func (this *Handler) Filter(node *registry.Node) bool
- func (this *Handler) Marshal(c *Context, reply interface{}) (data []byte, err error)
- func (this *Handler) Metadata() string
- func (this *Handler) Use(src interface{})
- type HandlerCaller
- type HandlerFilter
- type HandlerMetadata
- type HandlerSerialize
- type Metadata
- type Rpcx
- type Selector
Constants ¶
View Source
const ( //ServicesMetadataVersion = "ver" ServicesMetadataAverage = "Average" ServicesMetadataRpcServerId = "_rpc_srv_id" //服务器编号 ServicesMetadataRpcServerAddress = "_rpc_srv_addr" //rpc服务器ID,selector 中固定转发地址 )
View Source
const ( SelectorTypeLocal = "local" //本地程序内访问 SelectorTypeProcess = "process" //进程内访问 SelectorTypeDiscovery = "discovery" //服务发现 )
View Source
const (
ServicesServerIdAll = "-"
)
Variables ¶
View Source
var Options = &Rpcx{
Timeout: 2,
Network: "tcp",
Address: ":8100",
}
Options Etcd Redis 二选一
View Source
var Service = map[string]string{}
Functions ¶
func AddressFormat ¶
func AddressPrefix ¶
func AddressPrefix() string
func Discovery ¶
func Discovery() (client.ServiceDiscovery, error)
func EqualSliceString ¶
EqualSliceString 包含相同的字符串(可以顺序不同)
Types ¶
type Context ¶
func NewContext ¶
func (*Context) GetMetadata ¶
GetMetadata GET REQ Metadata
func (*Context) ServiceMethod ¶
func (*Context) ServicePath ¶
func (*Context) SetMetadata ¶
SetMetadata SET RES Metadata
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
type HandlerFilter ¶
type HandlerMetadata ¶
type HandlerMetadata func() string
type HandlerSerialize ¶
type Metadata ¶
func NewMetadata ¶
NewMetadata 创建新Metadata,参数k1,v1,k2,v2...
func (Metadata) SetAddress ¶
func (Metadata) SetContentType ¶
func (Metadata) SetServerId ¶
Click to show internal directories.
Click to hide internal directories.