Documentation
¶
Overview ¶
Package types is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
SocketTotalReply SocketPushArgs SocketMpushArgs MpushTarget SocketMpushReply SocketKickArgs SocketKickReply GwHosts
Index ¶
- Variables
- func DefaultProxySelector() func(*plugin.ProxyLabel) plugin.Caller
- type AccessToken
- type AuthFunc
- type Business
- type GwHosts
- func (*GwHosts) Descriptor() ([]byte, []int)
- func (m *GwHosts) GetHttp() []string
- func (m *GwHosts) GetSocket() []string
- func (m *GwHosts) Marshal() (dAtA []byte, err error)
- func (m *GwHosts) MarshalTo(dAtA []byte) (int, error)
- func (*GwHosts) ProtoMessage()
- func (m *GwHosts) Reset()
- func (m *GwHosts) Size() (n int)
- func (m *GwHosts) String() string
- func (m *GwHosts) Unmarshal(dAtA []byte) error
- type HttpHooks
- type MpushTarget
- func (*MpushTarget) Descriptor() ([]byte, []int)
- func (m *MpushTarget) GetAdditionalQuery() string
- func (m *MpushTarget) GetSessionId() string
- func (m *MpushTarget) Marshal() (dAtA []byte, err error)
- func (m *MpushTarget) MarshalTo(dAtA []byte) (int, error)
- func (*MpushTarget) ProtoMessage()
- func (m *MpushTarget) Reset()
- func (m *MpushTarget) Size() (n int)
- func (m *MpushTarget) String() string
- func (m *MpushTarget) Unmarshal(dAtA []byte) error
- type RequestArgs
- type SocketHooks
- type SocketKickArgs
- func (*SocketKickArgs) Descriptor() ([]byte, []int)
- func (m *SocketKickArgs) GetSessionId() string
- func (m *SocketKickArgs) Marshal() (dAtA []byte, err error)
- func (m *SocketKickArgs) MarshalTo(dAtA []byte) (int, error)
- func (*SocketKickArgs) ProtoMessage()
- func (m *SocketKickArgs) Reset()
- func (m *SocketKickArgs) Size() (n int)
- func (m *SocketKickArgs) String() string
- func (m *SocketKickArgs) Unmarshal(dAtA []byte) error
- type SocketKickReply
- func (*SocketKickReply) Descriptor() ([]byte, []int)
- func (m *SocketKickReply) GetExisted() bool
- func (m *SocketKickReply) Marshal() (dAtA []byte, err error)
- func (m *SocketKickReply) MarshalTo(dAtA []byte) (int, error)
- func (*SocketKickReply) ProtoMessage()
- func (m *SocketKickReply) Reset()
- func (m *SocketKickReply) Size() (n int)
- func (m *SocketKickReply) String() string
- func (m *SocketKickReply) Unmarshal(dAtA []byte) error
- type SocketMpushArgs
- func (*SocketMpushArgs) Descriptor() ([]byte, []int)
- func (m *SocketMpushArgs) GetBody() []byte
- func (m *SocketMpushArgs) GetBodyCodec() int32
- func (m *SocketMpushArgs) GetTarget() []*MpushTarget
- func (m *SocketMpushArgs) GetUri() string
- func (m *SocketMpushArgs) Marshal() (dAtA []byte, err error)
- func (m *SocketMpushArgs) MarshalTo(dAtA []byte) (int, error)
- func (*SocketMpushArgs) ProtoMessage()
- func (m *SocketMpushArgs) Reset()
- func (m *SocketMpushArgs) Size() (n int)
- func (m *SocketMpushArgs) String() string
- func (m *SocketMpushArgs) Unmarshal(dAtA []byte) error
- type SocketMpushReply
- func (*SocketMpushReply) Descriptor() ([]byte, []int)
- func (m *SocketMpushReply) GetFailureSessionIds() []string
- func (m *SocketMpushReply) Marshal() (dAtA []byte, err error)
- func (m *SocketMpushReply) MarshalTo(dAtA []byte) (int, error)
- func (*SocketMpushReply) ProtoMessage()
- func (m *SocketMpushReply) Reset()
- func (m *SocketMpushReply) Size() (n int)
- func (m *SocketMpushReply) String() string
- func (m *SocketMpushReply) Unmarshal(dAtA []byte) error
- type SocketPushArgs
- func (*SocketPushArgs) Descriptor() ([]byte, []int)
- func (m *SocketPushArgs) GetBody() []byte
- func (m *SocketPushArgs) GetBodyCodec() int32
- func (m *SocketPushArgs) GetSessionId() string
- func (m *SocketPushArgs) GetUri() string
- func (m *SocketPushArgs) Marshal() (dAtA []byte, err error)
- func (m *SocketPushArgs) MarshalTo(dAtA []byte) (int, error)
- func (*SocketPushArgs) ProtoMessage()
- func (m *SocketPushArgs) Reset()
- func (m *SocketPushArgs) Size() (n int)
- func (m *SocketPushArgs) String() string
- func (m *SocketPushArgs) Unmarshal(dAtA []byte) error
- type SocketPushReply
- type SocketTotalArgs
- type SocketTotalReply
- func (*SocketTotalReply) Descriptor() ([]byte, []int)
- func (m *SocketTotalReply) GetConnTotal() int32
- func (m *SocketTotalReply) Marshal() (dAtA []byte, err error)
- func (m *SocketTotalReply) MarshalTo(dAtA []byte) (int, error)
- func (*SocketTotalReply) ProtoMessage()
- func (m *SocketTotalReply) Reset()
- func (m *SocketTotalReply) Size() (n int)
- func (m *SocketTotalReply) String() string
- func (m *SocketTotalReply) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") )
Functions ¶
func DefaultProxySelector ¶
func DefaultProxySelector() func(*plugin.ProxyLabel) plugin.Caller
DefaultProxySelector creates a new default proxy caller selector.
Types ¶
type AccessToken ¶
type AccessToken interface {
// String returns the access token string.
String() string
// SessionId specifies the string as the session ID.
SessionId() string
// Uid returns the user id.
Uid() string
// DeviceId returns the device id.
DeviceId() string
// AddedQuery the user information will be appended to the URI query part.
AddedQuery() *utils.Args
}
AccessToken access token info
type AuthFunc ¶
type AuthFunc func(authInfo string) (AccessToken, *tp.Rerror)
AuthFunc Verifies access token
func DefaultAuthFunc ¶
func DefaultAuthFunc() AuthFunc
DefaultAuthFunc returns the default authorization function for access behavior.
type Business ¶
type Business struct {
// AuthFunc Verifies access token
AuthFunc func(accessToken string) (AccessToken, *tp.Rerror)
// SocketHooks TCP socket connecting event hooks
SocketHooks
// HttpHooks HTTP connecting event hooks
HttpHooks
// ProxySelector returns proxy caller by label.
ProxySelector func(*plugin.ProxyLabel) plugin.Caller
// InnerServerPlugins inner server plugins
InnerServerPlugins []tp.Plugin
}
Business implement your real business logic
func DefaultBusiness ¶
func DefaultBusiness() *Business
DefaultBusiness creates a new default Business object.
type GwHosts ¶
type GwHosts struct {
Http []string `protobuf:"bytes,1,rep,name=http" json:"http,omitempty"`
Socket []string `protobuf:"bytes,2,rep,name=socket" json:"socket,omitempty"`
}
func (*GwHosts) Descriptor ¶
func (*GwHosts) ProtoMessage ¶
func (*GwHosts) ProtoMessage()
type HttpHooks ¶ added in v1.1.0
type HttpHooks interface {
// OnRequest is called when the client requests.
OnRequest(params RequestArgs, body []byte, authFunc AuthFunc) (AccessToken, []socket.PacketSetting, *tp.Rerror)
}
HttpHooks HTTP connecting event hooks
func DefaultHttpHooks ¶ added in v1.1.0
func DefaultHttpHooks() HttpHooks
DefaultHttpHooks creates a new default HttpHooks object.
type MpushTarget ¶
type MpushTarget struct {
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
AdditionalQuery string `protobuf:"bytes,2,opt,name=additional_query,json=additionalQuery,proto3" json:"additional_query,omitempty"`
}
func (*MpushTarget) Descriptor ¶
func (*MpushTarget) Descriptor() ([]byte, []int)
func (*MpushTarget) GetAdditionalQuery ¶
func (m *MpushTarget) GetAdditionalQuery() string
func (*MpushTarget) GetSessionId ¶
func (m *MpushTarget) GetSessionId() string
func (*MpushTarget) Marshal ¶
func (m *MpushTarget) Marshal() (dAtA []byte, err error)
func (*MpushTarget) ProtoMessage ¶
func (*MpushTarget) ProtoMessage()
func (*MpushTarget) Reset ¶
func (m *MpushTarget) Reset()
func (*MpushTarget) Size ¶
func (m *MpushTarget) Size() (n int)
func (*MpushTarget) String ¶
func (m *MpushTarget) String() string
func (*MpushTarget) Unmarshal ¶
func (m *MpushTarget) Unmarshal(dAtA []byte) error
type RequestArgs ¶
type RequestArgs interface {
// Query returns query arguments from request URI.
QueryArgs() *fasthttp.Args
// Header returns the header object of request.
Header() *fasthttp.RequestHeader
}
RequestArgs http query parameters
type SocketHooks ¶ added in v1.1.0
type SocketHooks interface {
// OnLogon is called when the client goes online.
OnLogon(plugin.AuthSession, AccessToken) *tp.Rerror
// OnLogoff is called when the client goes offline.
OnLogoff(tp.BaseSession) *tp.Rerror
// GetSession returns session from peer by uid.
GetSession(peer tp.Peer, uid string) (tp.Session, *tp.Rerror)
//PreWritePush is executed before writing PUSH packet.
PreWritePush(tp.WriteCtx) *tp.Rerror
}
SocketHooks TCP socket connecting event hooks
func DefaultSocketHooks ¶ added in v1.1.0
func DefaultSocketHooks() SocketHooks
DefaultSocketHooks creates a new default SocketHooks object.
type SocketKickArgs ¶
type SocketKickArgs struct {
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
}
func (*SocketKickArgs) Descriptor ¶
func (*SocketKickArgs) Descriptor() ([]byte, []int)
func (*SocketKickArgs) GetSessionId ¶
func (m *SocketKickArgs) GetSessionId() string
func (*SocketKickArgs) Marshal ¶
func (m *SocketKickArgs) Marshal() (dAtA []byte, err error)
func (*SocketKickArgs) ProtoMessage ¶
func (*SocketKickArgs) ProtoMessage()
func (*SocketKickArgs) Reset ¶
func (m *SocketKickArgs) Reset()
func (*SocketKickArgs) Size ¶
func (m *SocketKickArgs) Size() (n int)
func (*SocketKickArgs) String ¶
func (m *SocketKickArgs) String() string
func (*SocketKickArgs) Unmarshal ¶
func (m *SocketKickArgs) Unmarshal(dAtA []byte) error
type SocketKickReply ¶
type SocketKickReply struct {
Existed bool `protobuf:"varint,1,opt,name=existed,proto3" json:"existed,omitempty"`
}
func (*SocketKickReply) Descriptor ¶
func (*SocketKickReply) Descriptor() ([]byte, []int)
func (*SocketKickReply) GetExisted ¶
func (m *SocketKickReply) GetExisted() bool
func (*SocketKickReply) Marshal ¶
func (m *SocketKickReply) Marshal() (dAtA []byte, err error)
func (*SocketKickReply) ProtoMessage ¶
func (*SocketKickReply) ProtoMessage()
func (*SocketKickReply) Reset ¶
func (m *SocketKickReply) Reset()
func (*SocketKickReply) Size ¶
func (m *SocketKickReply) Size() (n int)
func (*SocketKickReply) String ¶
func (m *SocketKickReply) String() string
func (*SocketKickReply) Unmarshal ¶
func (m *SocketKickReply) Unmarshal(dAtA []byte) error
type SocketMpushArgs ¶
type SocketMpushArgs struct {
Target []*MpushTarget `protobuf:"bytes,1,rep,name=target" json:"target,omitempty"`
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
BodyCodec int32 `protobuf:"varint,4,opt,name=body_codec,json=bodyCodec,proto3" json:"body_codec,omitempty"`
}
func (*SocketMpushArgs) Descriptor ¶
func (*SocketMpushArgs) Descriptor() ([]byte, []int)
func (*SocketMpushArgs) GetBody ¶
func (m *SocketMpushArgs) GetBody() []byte
func (*SocketMpushArgs) GetBodyCodec ¶
func (m *SocketMpushArgs) GetBodyCodec() int32
func (*SocketMpushArgs) GetTarget ¶
func (m *SocketMpushArgs) GetTarget() []*MpushTarget
func (*SocketMpushArgs) GetUri ¶
func (m *SocketMpushArgs) GetUri() string
func (*SocketMpushArgs) Marshal ¶
func (m *SocketMpushArgs) Marshal() (dAtA []byte, err error)
func (*SocketMpushArgs) ProtoMessage ¶
func (*SocketMpushArgs) ProtoMessage()
func (*SocketMpushArgs) Reset ¶
func (m *SocketMpushArgs) Reset()
func (*SocketMpushArgs) Size ¶
func (m *SocketMpushArgs) Size() (n int)
func (*SocketMpushArgs) String ¶
func (m *SocketMpushArgs) String() string
func (*SocketMpushArgs) Unmarshal ¶
func (m *SocketMpushArgs) Unmarshal(dAtA []byte) error
type SocketMpushReply ¶
type SocketMpushReply struct {
FailureSessionIds []string `protobuf:"bytes,1,rep,name=failure_session_ids,json=failureSessionIds" json:"failure_session_ids,omitempty"`
}
func (*SocketMpushReply) Descriptor ¶
func (*SocketMpushReply) Descriptor() ([]byte, []int)
func (*SocketMpushReply) GetFailureSessionIds ¶
func (m *SocketMpushReply) GetFailureSessionIds() []string
func (*SocketMpushReply) Marshal ¶
func (m *SocketMpushReply) Marshal() (dAtA []byte, err error)
func (*SocketMpushReply) ProtoMessage ¶
func (*SocketMpushReply) ProtoMessage()
func (*SocketMpushReply) Reset ¶
func (m *SocketMpushReply) Reset()
func (*SocketMpushReply) Size ¶
func (m *SocketMpushReply) Size() (n int)
func (*SocketMpushReply) String ¶
func (m *SocketMpushReply) String() string
func (*SocketMpushReply) Unmarshal ¶
func (m *SocketMpushReply) Unmarshal(dAtA []byte) error
type SocketPushArgs ¶ added in v1.1.0
type SocketPushArgs struct {
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
BodyCodec int32 `protobuf:"varint,4,opt,name=body_codec,json=bodyCodec,proto3" json:"body_codec,omitempty"`
}
func (*SocketPushArgs) Descriptor ¶ added in v1.1.0
func (*SocketPushArgs) Descriptor() ([]byte, []int)
func (*SocketPushArgs) GetBody ¶ added in v1.1.0
func (m *SocketPushArgs) GetBody() []byte
func (*SocketPushArgs) GetBodyCodec ¶ added in v1.1.0
func (m *SocketPushArgs) GetBodyCodec() int32
func (*SocketPushArgs) GetSessionId ¶
func (m *SocketPushArgs) GetSessionId() string
func (*SocketPushArgs) GetUri ¶ added in v1.1.0
func (m *SocketPushArgs) GetUri() string
func (*SocketPushArgs) Marshal ¶ added in v1.1.0
func (m *SocketPushArgs) Marshal() (dAtA []byte, err error)
func (*SocketPushArgs) MarshalTo ¶ added in v1.1.0
func (m *SocketPushArgs) MarshalTo(dAtA []byte) (int, error)
func (*SocketPushArgs) ProtoMessage ¶ added in v1.1.0
func (*SocketPushArgs) ProtoMessage()
func (*SocketPushArgs) Reset ¶ added in v1.1.0
func (m *SocketPushArgs) Reset()
func (*SocketPushArgs) Size ¶ added in v1.1.0
func (m *SocketPushArgs) Size() (n int)
func (*SocketPushArgs) String ¶ added in v1.1.0
func (m *SocketPushArgs) String() string
func (*SocketPushArgs) Unmarshal ¶ added in v1.1.0
func (m *SocketPushArgs) Unmarshal(dAtA []byte) error
type SocketTotalReply ¶ added in v1.1.0
type SocketTotalReply struct {
ConnTotal int32 `protobuf:"varint,1,opt,name=conn_total,json=connTotal,proto3" json:"conn_total,omitempty"`
}
func (*SocketTotalReply) Descriptor ¶ added in v1.1.0
func (*SocketTotalReply) Descriptor() ([]byte, []int)
func (*SocketTotalReply) GetConnTotal ¶ added in v1.1.0
func (m *SocketTotalReply) GetConnTotal() int32
func (*SocketTotalReply) Marshal ¶ added in v1.1.0
func (m *SocketTotalReply) Marshal() (dAtA []byte, err error)
func (*SocketTotalReply) MarshalTo ¶ added in v1.1.0
func (m *SocketTotalReply) MarshalTo(dAtA []byte) (int, error)
func (*SocketTotalReply) ProtoMessage ¶ added in v1.1.0
func (*SocketTotalReply) ProtoMessage()
func (*SocketTotalReply) Reset ¶ added in v1.1.0
func (m *SocketTotalReply) Reset()
func (*SocketTotalReply) Size ¶ added in v1.1.0
func (m *SocketTotalReply) Size() (n int)
func (*SocketTotalReply) String ¶ added in v1.1.0
func (m *SocketTotalReply) String() string
func (*SocketTotalReply) Unmarshal ¶ added in v1.1.0
func (m *SocketTotalReply) Unmarshal(dAtA []byte) error
Click to show internal directories.
Click to hide internal directories.