Documentation ¶
Index ¶
- Constants
- Variables
- func CodeText(statCode int32) string
- func DefaultBodyCodec() codec.Codec
- func GraceSignal()
- func HTTPServiceMethodMapper(prefix, name string) string
- func NewInheritedListener(addr net.Addr, tlsConfig *tls.Config) (lis net.Listener, err error)
- func NewTLSConfigFromFile(tlsCertFile, tlsKeyFile string, insecureSkipVerifyForClient ...bool) (*tls.Config, error)
- func PopParentAddr(network, host, addr string) string
- func PushParentAddr(network, host, addr string)
- func Reboot(timeout ...time.Duration)
- func SetDefaultBodyCodec(codecID byte) error
- func SetServiceMethodMapper(mapper ServiceMethodMapper)
- func SetShutdown(timeout time.Duration, firstFunc, beforeExitingFunc func() error)
- func Shutdown(timeout ...time.Duration)
- type AfterAcceptPlugin
- type AfterDialPlugin
- type AfterDisconnectPlugin
- type AfterListenPlugin
- type AfterNewEndpointPlugin
- type AfterReadCallBodyPlugin
- type AfterReadCallHeaderPlugin
- type AfterReadPushBodyPlugin
- type AfterReadPushHeaderPlugin
- type AfterReadReplyBodyPlugin
- type AfterReadReplyHeaderPlugin
- type AfterRegRouterPlugin
- type AfterWriteCallPlugin
- type AfterWritePushPlugin
- type AfterWriteReplyPlugin
- type BaseEndpoint
- type BaseSession
- type BeforeNewEndpointPlugin
- type BeforeReadCallBodyPlugin
- type BeforeReadHeaderPlugin
- type BeforeReadPushBodyPlugin
- type BeforeReadReplyBodyPlugin
- type BeforeWriteCallPlugin
- type BeforeWritePushPlugin
- type BeforeWriteReplyPlugin
- type CallCmd
- type CallCtx
- type CtxSession
- type Dialer
- func (that *Dialer) Dial(addr string) (net.Conn, error)
- func (that *Dialer) DialTimeout() time.Duration
- func (that *Dialer) LocalAddr() net.Addr
- func (that *Dialer) Network() string
- func (that *Dialer) RedialInterval() time.Duration
- func (that *Dialer) RedialTimes() int
- func (that *Dialer) TLSConfig() *tls.Config
- type EarlyCtx
- type EarlyEndpoint
- type EarlySession
- type Endpoint
- type EndpointConfig
- type FakeAddr
- type Handler
- func (that *Handler) ArgElemType() reflect.Type
- func (that *Handler) IsCall() bool
- func (that *Handler) IsPush() bool
- func (that *Handler) IsUnknown() bool
- func (that *Handler) Name() string
- func (that *Handler) NewArgValue() reflect.Value
- func (that *Handler) ReplyType() reflect.Type
- func (that *Handler) RouterTypeName() string
- type Plugin
- type PluginContainer
- type PushCtx
- type ReadCtx
- type Router
- func (that *Router) RouteCall(callCtrlStruct interface{}, plugin ...Plugin) []string
- func (that *Router) RouteCallFunc(callHandleFunc interface{}, plugin ...Plugin) string
- func (that *Router) RoutePush(pushCtrlStruct interface{}, plugin ...Plugin) []string
- func (that *Router) RoutePushFunc(pushHandleFunc interface{}, plugin ...Plugin) string
- func (that *Router) SetUnknownCall(fn func(UnknownCallCtx) (interface{}, *status.Status), plugin ...Plugin)
- func (that *Router) SetUnknownPush(fn func(UnknownPushCtx) *status.Status, plugin ...Plugin)
- func (that *Router) SubRoute(prefix string, plugin ...Plugin) *SubRouter
- type ServiceMethodMapper
- type Session
- type SessionHub
- type Status
- type SubRouter
- func (that *SubRouter) Root() *Router
- func (that *SubRouter) RouteCall(callCtrlStruct interface{}, plugin ...Plugin) []string
- func (that *SubRouter) RouteCallFunc(callHandleFunc interface{}, plugin ...Plugin) string
- func (that *SubRouter) RoutePush(pushCtrlStruct interface{}, plugin ...Plugin) []string
- func (that *SubRouter) RoutePushFunc(pushHandleFunc interface{}, plugin ...Plugin) string
- func (that *SubRouter) SubRoute(prefix string, plugin ...Plugin) *SubRouter
- func (that *SubRouter) ToRouter() *Router
- type UnknownCallCtx
- type UnknownPushCtx
- type WriteCtx
Constants ¶
const ( CodeUnknownError int32 = -1 CodeOK int32 = 0 // nil error (ok) CodeNoError int32 = CodeOK // nil error (ok) CodeInvalidOp int32 = 1 CodeWrongConn int32 = 100 CodeConnClosed int32 = 102 CodeWriteFailed int32 = 104 CodeDialFailed int32 = 105 CodeBadMessage int32 = 400 CodeNotFound int32 = 404 CodeMTypeNotAllowed int32 = 405 CodeHandleTimeout int32 = 408 CodeInternalServerError int32 = 500 CodeBadGateway int32 = 502 )
框架保留 Status code 建议自定义代码大于1000 未知错误:-1 发送错误: 100-199 消息处理错误: 400-499 接收错误: 500-599
Variables ¶
var DefaultProtoFunc = socket.DefaultProtoFunc
DefaultProtoFunc 默认传输协议
var ErrListenClosed = errors.New("listener is closed")
var GetReadLimit = message.MsgSizeLimit
GetReadLimit 获取消息最大长度限制
var (
NewStatus = status.New
)
var SetDefaultProtoFunc = socket.SetDefaultProtoFunc
SetDefaultProtoFunc 设置默认传输协议
var SetReadLimit = message.SetMsgSizeLimit
SetReadLimit 设置消息最大长度限制
var SetSocketKeepAlive = socket.SetKeepAlive
SetSocketKeepAlive 开启关闭链接保活
var SetSocketKeepAlivePeriod = socket.SetKeepAlivePeriod
SetSocketKeepAlivePeriod 链接保活间隔时间
var SetSocketNoDelay = socket.SetNoDelay
SetSocketNoDelay 开启关闭no delay算法
var SetSocketReadBuffer = socket.SetReadBuffer
SetSocketReadBuffer 设置链接读缓冲区长度
var SetSocketWriteBuffer = socket.SetWriteBuffer
SetSocketWriteBuffer 设置链接写缓冲区长度
var SocketReadBuffer = socket.ReadBuffer
SocketReadBuffer 获取链接读缓冲区长度
var SocketWriteBuffer = socket.WriteBuffer
SocketWriteBuffer 获取链接写缓冲区长度
Functions ¶
func DefaultBodyCodec ¶
func GraceSignal ¶
func GraceSignal()
func HTTPServiceMethodMapper ¶
HTTPServiceMethodMapper like most RPC services service method mapper. Such as: user/get It is the default mapper. The mapping rule of struct(func) name to service methods:
`AaBb` -> `/aa_bb` `ABcXYz` -> `/abc_xyz` `Aa__Bb` -> `/aa_bb` `aa__bb` -> `/aa_bb` `ABC__XYZ` -> `/abc_xyz` `Aa_Bb` -> `/aa/bb` `aa_bb` -> `/aa/bb` `ABC_XYZ` -> `/abc/xyz`
func NewInheritedListener ¶
NewInheritedListener 创建一个支持优雅重启,支持继承监听的监听器
func NewTLSConfigFromFile ¶
func NewTLSConfigFromFile(tlsCertFile, tlsKeyFile string, insecureSkipVerifyForClient ...bool) (*tls.Config, error)
NewTLSConfigFromFile 通过证书文件生成证书信息
func PopParentAddr ¶
PopParentAddr 从监听变量中出栈指定的地址端口
func PushParentAddr ¶
func PushParentAddr(network, host, addr string)
PushParentAddr 把监听的地址端口写入到变量,优雅结束的时候写入到环境变量,让子进程使用
func SetDefaultBodyCodec ¶
SetDefaultBodyCodec 设置默认消息体编码格式
func SetServiceMethodMapper ¶
func SetServiceMethodMapper(mapper ServiceMethodMapper)
func SetShutdown ¶
SetShutdown 设置优化退出方案基本参数
Types ¶
type AfterAcceptPlugin ¶
type AfterAcceptPlugin interface { Plugin AfterAccept(EarlySession) *Status }
AfterAcceptPlugin 作为服务端,接收到客户端的链接后触发该事件
type AfterDialPlugin ¶
type AfterDialPlugin interface { Plugin AfterDial(sess EarlySession, isRedial bool) *Status }
AfterDialPlugin 作为客户端链接到服务端成功以后触发该事件
type AfterDisconnectPlugin ¶
type AfterDisconnectPlugin interface { Plugin AfterDisconnect(BaseSession) *Status }
AfterDisconnectPlugin 断开会话以后触发该事件
type AfterListenPlugin ¶
AfterListenPlugin 监听以后触发该事件
type AfterNewEndpointPlugin ¶
type AfterNewEndpointPlugin interface { Plugin AfterNewEndpoint(EarlyEndpoint) error }
AfterNewEndpointPlugin 创建Endpoint之后触发该事件
type AfterReadCallBodyPlugin ¶
AfterReadCallBodyPlugin 读取CALL消息的body之后触发该事件
type AfterReadCallHeaderPlugin ¶
AfterReadCallHeaderPlugin 读取CALL消息的Header之后触发该事件
type AfterReadPushBodyPlugin ¶
AfterReadPushBodyPlugin 读取PUSH消息body之后触发该事件
type AfterReadPushHeaderPlugin ¶
AfterReadPushHeaderPlugin 读取PUSH消息Header之后触发该事件
type AfterReadReplyBodyPlugin ¶
AfterReadReplyBodyPlugin 读取REPLY消息body之后触发该事件
type AfterReadReplyHeaderPlugin ¶
AfterReadReplyHeaderPlugin 读取REPLY消息Header之前触发该事件
type AfterRegRouterPlugin ¶
AfterRegRouterPlugin 路由注册成功触发该事件
type AfterWriteCallPlugin ¶
AfterWriteCallPlugin 写入CALL消息成功之后触发该事件
type AfterWritePushPlugin ¶
AfterWritePushPlugin 写入PUSH消息成功之后触发该事件
type AfterWriteReplyPlugin ¶
AfterWriteReplyPlugin 写入Reply消息成功之后触发该事件
type BaseEndpoint ¶
type BaseEndpoint interface { // Close 关闭该端点 Close() (err error) // CountSession 统计该端点上的session数量 CountSession() int // GetSession 获取指定ID的 session GetSession(sessionID string) (Session, bool) // RangeSession 循环迭代session RangeSession(fn func(sess Session) bool) // SetTLSConfig 设置证书配置 SetTLSConfig(tlsConfig *tls.Config) // SetTLSConfigFromFile 从文件中读取证书并设置证书配置 SetTLSConfigFromFile(tlsCertFile, tlsKeyFile string, insecureSkipVerifyForClient ...bool) error // TLSConfig tls配置对象 TLSConfig() *tls.Config // PluginContainer 插件容器对象 PluginContainer() *PluginContainer }
type BaseSession ¶
type BaseSession interface { Endpoint() Endpoint // ID 获取id ID() string // LocalAddr 本地地址 LocalAddr() net.Addr // RemoteAddr 远端地址 RemoteAddr() net.Addr // Swap 返回交换区的内容 Swap() *dmap.Map }
BaseSession 基础的session
type BeforeNewEndpointPlugin ¶
type BeforeNewEndpointPlugin interface { Plugin BeforeNewEndpoint(*EndpointConfig, *PluginContainer) error }
BeforeNewEndpointPlugin 创建Endpoint之前触发该事件
type BeforeReadCallBodyPlugin ¶
BeforeReadCallBodyPlugin 读取CALL 消息的body之前触发该事件
type BeforeReadHeaderPlugin ¶
BeforeReadHeaderPlugin 执行读取Header之前触发该事件
type BeforeReadPushBodyPlugin ¶
BeforeReadPushBodyPlugin 读取PUSH消息body之前触发该事件
type BeforeReadReplyBodyPlugin ¶
BeforeReadReplyBodyPlugin 读取REPLY消息body之前触发该事件
type BeforeWriteCallPlugin ¶
BeforeWriteCallPlugin 写入CALL消息之前触发该事件
type BeforeWritePushPlugin ¶
BeforeWritePushPlugin 写入PUSH消息之前触发该事件
type BeforeWriteReplyPlugin ¶
BeforeWriteReplyPlugin 写入Reply消息之前触发该事件
type CallCmd ¶
type CallCmd interface { TraceEndpoint() (e Endpoint, found bool) TraceSession() (sess Session, found bool) // Context 协程上下文 Context() context.Context // Output 发送的消息 Output() message.Message // StatusOK 状态是否是OK StatusOK() bool // Status 状态 Status() *Status // Done 返回指示是否已经完毕的chan Done() <-chan struct{} // Reply 返回应答 Reply() (interface{}, *Status) // InputBodyCodec 接收到的消息使用的编码 InputBodyCodec() byte // InputMeta 接收到的消息传入的元数据 InputMeta() *dmap.Map // CostTime 消耗的时间 CostTime() time.Duration }
CallCmd CALL 命令调用后,响应操作的命令
type CallCtx ¶
type CallCtx interface { // Input 获取传入的消息 Input() message.Message // GetBodyCodec 获取当前消息的编码格式 GetBodyCodec() byte // Output 将要发送的消息对象 Output() message.Message // ReplyBodyCodec 获取响应消息的编码格式 ReplyBodyCodec() byte // SetBodyCodec 设置响应消息的编码格式 SetBodyCodec(byte) // SetMeta 设置指定key的值 SetMeta(key, value string) // AddTFilterId 设置回复消息传输层的编码过滤方法id AddTFilterId(filterID ...byte) // contains filtered or unexported methods }
CallCtx call消息使用的上下文
type CtxSession ¶
type CtxSession interface { // ID 获取id ID() string // LocalAddr 本地地址 LocalAddr() net.Addr // RemoteAddr 远端地址 RemoteAddr() net.Addr // Swap 返回交换区的内容 Swap() *dmap.Map // CloseNotify 返回该链接被关闭时候的通知 CloseNotify() <-chan struct{} // Health 检查该session是否健康 Health() bool // AsyncCall 发送消息,并异步接收响应 AsyncCall(serviceMethod string, args interface{}, result interface{}, callCmdChan chan<- CallCmd, setting ...message.MsgSetting) CallCmd // Call 发送消息并获得响应值 Call(serviceMethod string, args interface{}, result interface{}, setting ...message.MsgSetting) CallCmd // Push 发送消息,不接收响应,只返回发送状态 Push(serviceMethod string, args interface{}, setting ...message.MsgSetting) *status.Status // SessionAge 获取session最大的生存周期 SessionAge() time.Duration // ContextAge 获取 CALL 和 PUSH 消息的最大生存周期 ContextAge() time.Duration }
CtxSession 在处理程序上下文中传递的会话对象
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
Dialer 拨号器
func NewDialer ¶
func NewDialer(localAddr net.Addr, tlsConfig *tls.Config, dialTimeout, redialInterval time.Duration, redialTimes int) *Dialer
NewDialer 创建一个拨号器
func (*Dialer) DialTimeout ¶
DialTimeout 获取拨号器拨号时候的超时时间
func (*Dialer) RedialInterval ¶
RedialInterval 返回拨号器重试拨号时候的间隔
type EarlyCtx ¶
type EarlyCtx interface { // Endpoint 获取当前Endpoint Endpoint() Endpoint // Session 返回当前的session Session() CtxSession // IP 返回远端ip IP() string // RealIP 返回远端真实ip RealIP() string // Swap 返回自定义交换区数据 Swap() *dmap.Map // Context 获取上下文 Context() context.Context }
EarlyCtx 基础上下文
type EarlyEndpoint ¶
type EarlyEndpoint interface { BaseEndpoint // Router 获取路由对象 Router() *Router // SubRoute 获取分组路由对象 SubRoute(pathPrefix string, plugin ...Plugin) *SubRouter // RouteCall 通过struct注册CALL类型的处理程序,并且返回注册的路径列表 RouteCall(ctrlStruct interface{}, plugin ...Plugin) []string // RouteCallFunc 通过func注册CALL类型的处理程序,并且返回单个注册路径 RouteCallFunc(callHandleFunc interface{}, plugin ...Plugin) string // RoutePush 通过struct注册PUSH类型的处理程序,并且返回注册的路径列表 RoutePush(ctrlStruct interface{}, plugin ...Plugin) []string // RoutePushFunc 通过func注册PUSH类型的处理程序,并且返回单个注册路径 RoutePushFunc(pushHandleFunc interface{}, plugin ...Plugin) string // SetUnknownCall 设置默认处理程序,当没有找到CALL的处理程序时将调用该处理程序。 SetUnknownCall(fn func(UnknownCallCtx) (interface{}, *status.Status), plugin ...Plugin) // SetUnknownPush 设置默认处理程序,当没有找到PUSH的处理程序时将调用该处理程序。 SetUnknownPush(fn func(UnknownPushCtx) *status.Status, plugin ...Plugin) }
type EarlySession ¶
type EarlySession interface { Endpoint() Endpoint // LocalAddr 本地地址 LocalAddr() net.Addr // RemoteAddr 远端地址 RemoteAddr() net.Addr // Swap 临时存储区内容 Swap() *dmap.Map // SetID 设置seaside SetID(newID string) // ControlFD 原始链接的fd ControlFD(f func(fd uintptr)) error // ModifySocket 修改session的底层socket ModifySocket(fn func(conn net.Conn) (modifiedConn net.Conn, newProtoFunc proto.ProtoFunc)) // GetProtoFunc 获取协议方法 GetProtoFunc() proto.ProtoFunc // EarlySend 在会话刚建立的时候临时发送消息,不执行任何中间件 EarlySend(mType byte, serviceMethod string, body interface{}, stat *status.Status, setting ...message.MsgSetting) (opStat *status.Status) // EarlyReceive 在会话刚建立的时候临时接受信息,不执行任何中间件 EarlyReceive(newArgs message.NewBodyFunc, ctx ...context.Context) (input message.Message) // EarlyCall 在会话刚建立的时候临时调用call发送和接受消息,不执行任何中间件 EarlyCall(serviceMethod string, args, reply interface{}, callSetting ...message.MsgSetting) (opStat *status.Status) // EarlyReply 在会话刚建立的时候临时回复消息,不执行任何中间件 EarlyReply(req message.Message, body interface{}, stat *status.Status, setting ...message.MsgSetting) (opStat *status.Status) // RawPush 发送原始push消息,不执行任何中间件 RawPush(serviceMethod string, args interface{}, setting ...message.MsgSetting) (opStat *status.Status) // SessionAge 获取session最大的生存周期 SessionAge() time.Duration // ContextAge 获取 CALL 和 PUSH 消息的最大生存周期 ContextAge() time.Duration // SetSessionAge 设置session的最大生存周期 SetSessionAge(duration time.Duration) // SetContextAge 设置单个 CALL 和 PUSH 消息的最大生存周期 SetContextAge(duration time.Duration) }
EarlySession 尚未启动 goroutine 读取数据的链接会话
type Endpoint ¶
type Endpoint interface { EarlyEndpoint // ListenAndServe 打开服务监听 ListenAndServe(protoFunc ...socket.ProtoFunc) error // Dial 作为客户端链接到指定的服务 Dial(addr string, protoFunc ...socket.ProtoFunc) (Session, *status.Status) // ServeConn 传入指定的conn,生成session // 提示: // 1. 不支持断开链接后自动重拨 // 2. 不检查TLS // 3. 执行 PostAcceptPlugin 插件 ServeConn(conn net.Conn, protoFunc ...socket.ProtoFunc) (Session, *status.Status) }
func NewEndpoint ¶
func NewEndpoint(cfg EndpointConfig, globalLeftPlugin ...Plugin) Endpoint
type EndpointConfig ¶
type EndpointConfig struct { // 网络类型; tcp, tcp4, tcp6, unix, unixpacket, kcp or quic" Network string //当前要监听的服务器本地IP LocalIP string //需要监听的端口号 ListenPort uint16 // 默认的消息体编码格式 DefaultBodyCodec string //默认会话生命周期 DefaultSessionAge time.Duration //默认单次请求生命周期 DefaultContextAge time.Duration //外部配置慢处理定义时间 SlowCometDuration time.Duration //是否打印会话中请求的 body或 metadata PrintDetail bool // 是否统计消耗时间 CountTime bool // 作为客户端角色时,请求服务端的超时时间 DialTimeout time.Duration // 在链接中断时候,试图链接服务端的最大重试次数。仅限客户端角色使用 RedialTimes int //仅限客户端角色使用 试图链接服务端时候,重试的时间间隔 RedialInterval time.Duration // contains filtered or unexported fields }
EndpointConfig 端点的配置
func (*EndpointConfig) ListenAddr ¶
func (that *EndpointConfig) ListenAddr() net.Addr
ListenAddr 获取本地监听地址,服务器角色
func (*EndpointConfig) LocalAddr ¶
func (that *EndpointConfig) LocalAddr() net.Addr
LocalAddr 获取本地地址,客户端角色
type FakeAddr ¶
type FakeAddr struct {
// contains filtered or unexported fields
}
FakeAddr 是一个虚地址对象,实现了net.Add
func NewFakeAddr2 ¶
NewFakeAddr2 创建另一个不同参数的虚地址对象
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) RouterTypeName ¶
RouterTypeName 获取处理器的路由方法名 pnPush/pnCall/pnUnknownPush/pnUnknownCall
type PluginContainer ¶
type PluginContainer struct {
// contains filtered or unexported fields
}
PluginContainer 插件容器
func (*PluginContainer) AppendLeft ¶
func (that *PluginContainer) AppendLeft(plugins ...Plugin)
AppendLeft 追加插件到左边
func (*PluginContainer) AppendRight ¶
func (that *PluginContainer) AppendRight(plugins ...Plugin)
AppendRight 追加插件到右边
func (*PluginContainer) Remove ¶
func (that *PluginContainer) Remove(pluginName string) error
Remove 根据插件名移除插件
type PushCtx ¶
type PushCtx interface { // GetBodyCodec 获取当前消息的编码格式 GetBodyCodec() byte // contains filtered or unexported methods }
PushCtx push消息使用的上下文
type ReadCtx ¶
type ReadCtx interface { // Input 获取传入的消息 Input() message.Message // StatusOK 状态是否ok StatusOK() bool // Status 当前步骤的状态 Status() *status.Status // contains filtered or unexported methods }
ReadCtx 读取消息使用的上下文
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router 路由器
func (*Router) RouteCallFunc ¶
RouteCallFunc 注册func对象到路由器
func (*Router) RoutePushFunc ¶
RoutePushFunc 通过func注册PUSH类型的处理程序到路由器
func (*Router) SetUnknownCall ¶
func (that *Router) SetUnknownCall(fn func(UnknownCallCtx) (interface{}, *status.Status), plugin ...Plugin)
SetUnknownCall 注册默认的未知CALL处理方法
func (*Router) SetUnknownPush ¶
func (that *Router) SetUnknownPush(fn func(UnknownPushCtx) *status.Status, plugin ...Plugin)
SetUnknownPush 注册未知PUSH处理方法
type ServiceMethodMapper ¶
type Session ¶
type Session interface { Endpoint() Endpoint // SetID 设置session id SetID(newID string) // Close 关闭session Close() error CtxSession }
type SessionHub ¶
type SessionHub struct {
// contains filtered or unexported fields
}
type SubRouter ¶
type SubRouter struct {
// contains filtered or unexported fields
}
func (*SubRouter) RouteCallFunc ¶
RouteCallFunc 通过func注册单个 CALL 类型的处理程序,并返回它的注册路径
func (*SubRouter) RoutePushFunc ¶
RoutePushFunc 通过func注册PUSH类型的处理程序,并返回它的路径
type UnknownCallCtx ¶
type UnknownCallCtx interface { // GetBodyCodec 获取当前消息的编码格式 GetBodyCodec() byte // InputBodyBytes 传入消息体 InputBodyBytes() []byte // BuildBody 如果push消息是未知的消息,则使用v对象解析消息内容 BuildBody(v interface{}) (bodyCodec byte, err error) // SetBodyCodec 设置回复消息的编码格式 SetBodyCodec(byte) // SetMeta 设置指定key的值 SetMeta(key, value string) // AddTFilterId 设置回复消息传输层的编码过滤方法id AddTFilterId(filterID ...byte) // contains filtered or unexported methods }
UnknownCallCtx 未知call消息的上下文
type UnknownPushCtx ¶
type UnknownPushCtx interface { // GetBodyCodec 获取当前消息的编码格式 GetBodyCodec() byte // InputBodyBytes 传入消息体 InputBodyBytes() []byte // BuildBody 如果push消息是未知的消息,则使用v对象解析消息内容 BuildBody(v interface{}) (bodyCodec byte, err error) // contains filtered or unexported methods }
UnknownPushCtx 未知push消息的上下文