Documentation
¶
Overview ¶
Package types is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
TotalLongConnReply PushLongConnArgs GwHosts
Index ¶
- Variables
- type AccessToken
- type AccessTokenVerifier
- type Business
- type GwHosts
- func (*GwHosts) Descriptor() ([]byte, []int)
- func (m *GwHosts) GetHosts() []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 LongConnHooks
- type ProxyHooks
- type PushLongConnArgs
- func (*PushLongConnArgs) Descriptor() ([]byte, []int)
- func (m *PushLongConnArgs) GetBody() []byte
- func (m *PushLongConnArgs) GetBodyCodec() int32
- func (m *PushLongConnArgs) GetUid() string
- func (m *PushLongConnArgs) GetUri() string
- func (m *PushLongConnArgs) Marshal() (dAtA []byte, err error)
- func (m *PushLongConnArgs) MarshalTo(dAtA []byte) (int, error)
- func (*PushLongConnArgs) ProtoMessage()
- func (m *PushLongConnArgs) Reset()
- func (m *PushLongConnArgs) Size() (n int)
- func (m *PushLongConnArgs) String() string
- func (m *PushLongConnArgs) Unmarshal(dAtA []byte) error
- type PushLongConnReply
- type RequestArgs
- type ShortConnHooks
- type TotalLongConnArgs
- type TotalLongConnReply
- func (*TotalLongConnReply) Descriptor() ([]byte, []int)
- func (m *TotalLongConnReply) GetConnTotal() int32
- func (m *TotalLongConnReply) Marshal() (dAtA []byte, err error)
- func (m *TotalLongConnReply) MarshalTo(dAtA []byte) (int, error)
- func (*TotalLongConnReply) ProtoMessage()
- func (m *TotalLongConnReply) Reset()
- func (m *TotalLongConnReply) Size() (n int)
- func (m *TotalLongConnReply) String() string
- func (m *TotalLongConnReply) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") )
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken interface {
// Uid returns the user id.
Uid() string
// String returns the access token string.
String() string
}
AccessToken access token info
type AccessTokenVerifier ¶
type AccessTokenVerifier func(accessToken string) (AccessToken, *tp.Rerror)
AccessTokenVerifier access token verifier
func DefaultAccessTokenVerifier ¶
func DefaultAccessTokenVerifier() AccessTokenVerifier
DefaultAccessTokenVerifier returns the default access token verifier.
type Business ¶
type Business struct {
// ApiVersion long connection API version
ApiVersion string
// AccessTokenVerifier access token manager
AccessTokenVerifier
// LongConnHooks TCP socket connecting event hooks
LongConnHooks
// ShortConnHooks HTTP connecting event hooks
ShortConnHooks
// ProxyHooks proxy hooks
ProxyHooks
}
Business implement your real business logic
func DefaultBusiness ¶
func DefaultBusiness() *Business
DefaultBusiness creates a new default Business object.
type GwHosts ¶
type GwHosts struct {
Hosts []string `protobuf:"bytes,1,rep,name=hosts" json:"hosts,omitempty"`
}
func (*GwHosts) Descriptor ¶
func (*GwHosts) ProtoMessage ¶
func (*GwHosts) ProtoMessage()
type LongConnHooks ¶
type LongConnHooks interface {
// OnLogon is called when the client goes online.
OnLogon(AccessToken, plugin.AuthSession) *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
}
LongConnHooks TCP socket connecting event hooks
func DefaultLongConnHooks ¶
func DefaultLongConnHooks() LongConnHooks
DefaultLongConnHooks creates a new default LongConnHooks object.
type ProxyHooks ¶
type ProxyHooks interface {
// BeforePull is called before pulling the internal service.
BeforePull(uri string, args interface{}, reply interface{}, setting ...socket.PacketSetting) *tp.Rerror
// BeforePush is called before pushing the internal service.
BeforePush(uri string, args interface{}, setting ...socket.PacketSetting) *tp.Rerror
}
ProxyHooks proxy hooks
func DefaultProxyHooks ¶
func DefaultProxyHooks() ProxyHooks
DefaultProxyHooks creates a new default ProxyHooks object.
type PushLongConnArgs ¶
type PushLongConnArgs struct {
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,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 (*PushLongConnArgs) Descriptor ¶
func (*PushLongConnArgs) Descriptor() ([]byte, []int)
func (*PushLongConnArgs) GetBody ¶
func (m *PushLongConnArgs) GetBody() []byte
func (*PushLongConnArgs) GetBodyCodec ¶
func (m *PushLongConnArgs) GetBodyCodec() int32
func (*PushLongConnArgs) GetUid ¶
func (m *PushLongConnArgs) GetUid() string
func (*PushLongConnArgs) GetUri ¶
func (m *PushLongConnArgs) GetUri() string
func (*PushLongConnArgs) Marshal ¶
func (m *PushLongConnArgs) Marshal() (dAtA []byte, err error)
func (*PushLongConnArgs) ProtoMessage ¶
func (*PushLongConnArgs) ProtoMessage()
func (*PushLongConnArgs) Reset ¶
func (m *PushLongConnArgs) Reset()
func (*PushLongConnArgs) Size ¶
func (m *PushLongConnArgs) Size() (n int)
func (*PushLongConnArgs) String ¶
func (m *PushLongConnArgs) String() string
func (*PushLongConnArgs) Unmarshal ¶
func (m *PushLongConnArgs) Unmarshal(dAtA []byte) error
type RequestArgs ¶
type ShortConnHooks ¶
type ShortConnHooks interface {
// OnRequest is called when the client requests.
OnRequest(AccessToken, RequestArgs) ([]socket.PacketSetting, *tp.Rerror)
}
ShortConnHooks HTTP connecting event hooks
func DefaultShortConnHooks ¶
func DefaultShortConnHooks() ShortConnHooks
DefaultShortConnHooks creates a new default ShortConnHooks object.
type TotalLongConnReply ¶
type TotalLongConnReply struct {
ConnTotal int32 `protobuf:"varint,1,opt,name=conn_total,json=connTotal,proto3" json:"conn_total,omitempty"`
}
func (*TotalLongConnReply) Descriptor ¶
func (*TotalLongConnReply) Descriptor() ([]byte, []int)
func (*TotalLongConnReply) GetConnTotal ¶
func (m *TotalLongConnReply) GetConnTotal() int32
func (*TotalLongConnReply) Marshal ¶
func (m *TotalLongConnReply) Marshal() (dAtA []byte, err error)
func (*TotalLongConnReply) MarshalTo ¶
func (m *TotalLongConnReply) MarshalTo(dAtA []byte) (int, error)
func (*TotalLongConnReply) ProtoMessage ¶
func (*TotalLongConnReply) ProtoMessage()
func (*TotalLongConnReply) Reset ¶
func (m *TotalLongConnReply) Reset()
func (*TotalLongConnReply) Size ¶
func (m *TotalLongConnReply) Size() (n int)
func (*TotalLongConnReply) String ¶
func (m *TotalLongConnReply) String() string
func (*TotalLongConnReply) Unmarshal ¶
func (m *TotalLongConnReply) Unmarshal(dAtA []byte) error