Documentation ¶
Index ¶
- Constants
- Variables
- func HandleQueue(b []byte)
- func ModifyResponse(rsp *http.Response) (err error)
- type ECmd
- type ErrorRsp
- func (*ErrorRsp) Descriptor() ([]byte, []int)
- func (m *ErrorRsp) GetErrinfo() *Errorinfo
- func (*ErrorRsp) ProtoMessage()
- func (m *ErrorRsp) Reset()
- func (m *ErrorRsp) String() string
- func (m *ErrorRsp) XXX_DiscardUnknown()
- func (m *ErrorRsp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ErrorRsp) XXX_Merge(src proto.Message)
- func (m *ErrorRsp) XXX_Size() int
- func (m *ErrorRsp) XXX_Unmarshal(b []byte) error
- type Errorinfo
- func (*Errorinfo) Descriptor() ([]byte, []int)
- func (m *Errorinfo) GetErrorCode() uint32
- func (m *Errorinfo) GetErrorInfo() []byte
- func (*Errorinfo) ProtoMessage()
- func (m *Errorinfo) Reset()
- func (m *Errorinfo) String() string
- func (m *Errorinfo) XXX_DiscardUnknown()
- func (m *Errorinfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Errorinfo) XXX_Merge(src proto.Message)
- func (m *Errorinfo) XXX_Size() int
- func (m *Errorinfo) XXX_Unmarshal(b []byte) error
- type LoginNotifyReq
- func (*LoginNotifyReq) Descriptor() ([]byte, []int)
- func (m *LoginNotifyReq) GetUid() uint64
- func (*LoginNotifyReq) ProtoMessage()
- func (m *LoginNotifyReq) Reset()
- func (m *LoginNotifyReq) String() string
- func (m *LoginNotifyReq) XXX_DiscardUnknown()
- func (m *LoginNotifyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LoginNotifyReq) XXX_Merge(src proto.Message)
- func (m *LoginNotifyReq) XXX_Size() int
- func (m *LoginNotifyReq) XXX_Unmarshal(b []byte) error
- type MsgBody
- func (*MsgBody) Descriptor() ([]byte, []int)
- func (m *MsgBody) GetBody() []byte
- func (m *MsgBody) GetExtend() []byte
- func (*MsgBody) ProtoMessage()
- func (m *MsgBody) Reset()
- func (m *MsgBody) String() string
- func (m *MsgBody) XXX_DiscardUnknown()
- func (m *MsgBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgBody) XXX_Merge(src proto.Message)
- func (m *MsgBody) XXX_Size() int
- func (m *MsgBody) XXX_Unmarshal(b []byte) error
- type MsgHead
- func (*MsgHead) Descriptor() ([]byte, []int)
- func (m *MsgHead) GetApp() uint32
- func (m *MsgHead) GetBodyLen() uint32
- func (m *MsgHead) GetCacheIs() uint32
- func (m *MsgHead) GetEncrypt() uint32
- func (m *MsgHead) GetRouteId() uint64
- func (m *MsgHead) GetSeq() uint32
- func (m *MsgHead) GetServant() uint32
- func (m *MsgHead) GetServer() uint32
- func (m *MsgHead) GetVersion() uint32
- func (*MsgHead) ProtoMessage()
- func (m *MsgHead) Reset()
- func (m *MsgHead) String() string
- func (m *MsgHead) XXX_DiscardUnknown()
- func (m *MsgHead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgHead) XXX_Merge(src proto.Message)
- func (m *MsgHead) XXX_Size() int
- func (m *MsgHead) XXX_Unmarshal(b []byte) error
- type ProtoProtocol
- func (outInfo *ProtoProtocol) Close(info interface{}) error
- func (outInfo *ProtoProtocol) NewCodec(conn net.Conn, timeOut, heartbeat int) interface{}
- func (outInfo *ProtoProtocol) NoticeClose(info interface{})
- func (outInfo *ProtoProtocol) Receive(info interface{}) (interface{}, interface{}, error, int)
- func (outInfo *ProtoProtocol) Send(info interface{}, b interface{}) error
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetBody() []byte
- func (m *Request) GetSeq() uint32
- func (m *Request) GetServant() uint32
- func (m *Request) GetUid() uint64
- func (m *Request) GetVersion() uint32
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Respond
- func (*Respond) Descriptor() ([]byte, []int)
- func (m *Respond) GetBody() []byte
- func (m *Respond) GetExtend() []byte
- func (*Respond) ProtoMessage()
- func (m *Respond) Reset()
- func (m *Respond) String() string
- func (m *Respond) XXX_DiscardUnknown()
- func (m *Respond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Respond) XXX_Merge(src proto.Message)
- func (m *Respond) XXX_Size() int
- func (m *Respond) XXX_Unmarshal(b []byte) error
- type Server
- func (obj *Server) AddServant(imp impServer, objStr string)
- func (obj *Server) Dispatch(ctx context.Context, val interface{}, req *requestf.RequestPacket, ...) (err error)
- func (obj *Server) Handle(input Request) (output Respond, err error)
- func (obj *Server) SetServant(s model.Servant)
- func (obj *Server) TarsSetTimeout(t int)
- type StApp
- type StServer
- type StTarsHttpProxy
- type StTarsHttpProxyCommon
- type StTarsProxy
- type StTarsProxyTcpCommon
- type StTarsTcpProxy
- func (outInfo *StTarsTcpProxy) Close(info interface{})
- func (outInfo *StTarsTcpProxy) Handle(info, reqHead, reqBody interface{}) (outHeadRsp []byte, err error)
- func (outInfo *StTarsTcpProxy) HandlePre(info, reqHead, reqBody interface{}) (limitObj string, reqHeadOut, reqBodyOut interface{}, err error)
- func (outInfo *StTarsTcpProxy) InitProxy(key string) (err error)
- func (outInfo *StTarsTcpProxy) IsExit(info interface{}) int
- func (outInfo *StTarsTcpProxy) ReloadConf() (err error)
- func (outInfo *StTarsTcpProxy) TcpProxyGet(ip string) interface{}
- func (outInfo *StTarsTcpProxy) Verify(info interface{}) error
Constants ¶
View Source
const ( BITS = 2048 CMD_LOGOUT = 1999 CMD_HEART uint32 = 101 CONNECT_CLOSE int = 1 )
View Source
const MODIFY_RESPONSE = "ModifyResponse_key"
View Source
const TIMEOUT = "tcp_timeout"
Variables ¶
View Source
var ECmd_name = map[int32]string{
0: "UNKNOWN",
601: "E_LOGIN_NOTIFY_REQ",
}
View Source
var ECmd_value = map[string]int32{
"UNKNOWN": 0,
"E_LOGIN_NOTIFY_REQ": 601,
}
Functions ¶
func HandleQueue ¶
func HandleQueue(b []byte)
func ModifyResponse ¶
Types ¶
type ErrorRsp ¶
type ErrorRsp struct { Errinfo *Errorinfo `protobuf:"bytes,1,opt,name=errinfo,proto3" json:"errinfo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ErrorRsp) Descriptor ¶
func (*ErrorRsp) GetErrinfo ¶
func (*ErrorRsp) ProtoMessage ¶
func (*ErrorRsp) ProtoMessage()
func (*ErrorRsp) XXX_DiscardUnknown ¶
func (m *ErrorRsp) XXX_DiscardUnknown()
func (*ErrorRsp) XXX_Marshal ¶
func (*ErrorRsp) XXX_Unmarshal ¶
type Errorinfo ¶
type Errorinfo struct { ErrorCode uint32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` ErrorInfo []byte `protobuf:"bytes,2,opt,name=error_info,json=errorInfo,proto3" json:"error_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Errorinfo) Descriptor ¶
func (*Errorinfo) GetErrorCode ¶
func (*Errorinfo) GetErrorInfo ¶
func (*Errorinfo) ProtoMessage ¶
func (*Errorinfo) ProtoMessage()
func (*Errorinfo) XXX_DiscardUnknown ¶
func (m *Errorinfo) XXX_DiscardUnknown()
func (*Errorinfo) XXX_Marshal ¶
func (*Errorinfo) XXX_Unmarshal ¶
type LoginNotifyReq ¶
type LoginNotifyReq struct { Uid uint64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*LoginNotifyReq) Descriptor ¶
func (*LoginNotifyReq) Descriptor() ([]byte, []int)
func (*LoginNotifyReq) GetUid ¶
func (m *LoginNotifyReq) GetUid() uint64
func (*LoginNotifyReq) ProtoMessage ¶
func (*LoginNotifyReq) ProtoMessage()
func (*LoginNotifyReq) Reset ¶
func (m *LoginNotifyReq) Reset()
func (*LoginNotifyReq) String ¶
func (m *LoginNotifyReq) String() string
func (*LoginNotifyReq) XXX_DiscardUnknown ¶
func (m *LoginNotifyReq) XXX_DiscardUnknown()
func (*LoginNotifyReq) XXX_Marshal ¶
func (m *LoginNotifyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LoginNotifyReq) XXX_Merge ¶
func (m *LoginNotifyReq) XXX_Merge(src proto.Message)
func (*LoginNotifyReq) XXX_Size ¶
func (m *LoginNotifyReq) XXX_Size() int
func (*LoginNotifyReq) XXX_Unmarshal ¶
func (m *LoginNotifyReq) XXX_Unmarshal(b []byte) error
type MsgBody ¶
type MsgBody struct { Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` Extend []byte `protobuf:"bytes,2,opt,name=extend,proto3" json:"extend,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MsgBody) Descriptor ¶
func (*MsgBody) ProtoMessage ¶
func (*MsgBody) ProtoMessage()
func (*MsgBody) XXX_DiscardUnknown ¶
func (m *MsgBody) XXX_DiscardUnknown()
func (*MsgBody) XXX_Marshal ¶
func (*MsgBody) XXX_Unmarshal ¶
type MsgHead ¶
type MsgHead struct { BodyLen uint32 `protobuf:"fixed32,1,opt,name=body_len,json=bodyLen,proto3" json:"body_len,omitempty"` Version uint32 `protobuf:"fixed32,2,opt,name=version,proto3" json:"version,omitempty"` App uint32 `protobuf:"fixed32,3,opt,name=app,proto3" json:"app,omitempty"` Server uint32 `protobuf:"fixed32,4,opt,name=server,proto3" json:"server,omitempty"` Servant uint32 `protobuf:"fixed32,5,opt,name=servant,proto3" json:"servant,omitempty"` Seq uint32 `protobuf:"fixed32,6,opt,name=seq,proto3" json:"seq,omitempty"` RouteId uint64 `protobuf:"fixed64,7,opt,name=route_id,json=routeId,proto3" json:"route_id,omitempty"` Encrypt uint32 `protobuf:"fixed32,8,opt,name=encrypt,proto3" json:"encrypt,omitempty"` CacheIs uint32 `protobuf:"fixed32,9,opt,name=cache_is,json=cacheIs,proto3" json:"cache_is,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The request message containing the user's name.
func (*MsgHead) Descriptor ¶
func (*MsgHead) GetBodyLen ¶
func (*MsgHead) GetCacheIs ¶
func (*MsgHead) GetEncrypt ¶
func (*MsgHead) GetRouteId ¶
func (*MsgHead) GetServant ¶
func (*MsgHead) GetVersion ¶
func (*MsgHead) ProtoMessage ¶
func (*MsgHead) ProtoMessage()
func (*MsgHead) XXX_DiscardUnknown ¶
func (m *MsgHead) XXX_DiscardUnknown()
func (*MsgHead) XXX_Marshal ¶
func (*MsgHead) XXX_Unmarshal ¶
type ProtoProtocol ¶
type ProtoProtocol struct { }
func (*ProtoProtocol) Close ¶
func (outInfo *ProtoProtocol) Close(info interface{}) error
func (*ProtoProtocol) NewCodec ¶
func (outInfo *ProtoProtocol) NewCodec(conn net.Conn, timeOut, heartbeat int) interface{}
func (*ProtoProtocol) NoticeClose ¶
func (outInfo *ProtoProtocol) NoticeClose(info interface{})
func (*ProtoProtocol) Receive ¶
func (outInfo *ProtoProtocol) Receive(info interface{}) (interface{}, interface{}, error, int)
func (*ProtoProtocol) Send ¶
func (outInfo *ProtoProtocol) Send(info interface{}, b interface{}) error
type Request ¶
type Request struct { Version uint32 `protobuf:"fixed32,1,opt,name=version,proto3" json:"version,omitempty"` Servant uint32 `protobuf:"fixed32,2,opt,name=servant,proto3" json:"servant,omitempty"` Seq uint32 `protobuf:"fixed32,3,opt,name=seq,proto3" json:"seq,omitempty"` Uid uint64 `protobuf:"fixed64,4,opt,name=uid,proto3" json:"uid,omitempty"` Body []byte `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The request message containing the user's name.
func (*Request) Descriptor ¶
func (*Request) GetServant ¶
func (*Request) GetVersion ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
type Respond ¶
type Respond struct { Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` Extend []byte `protobuf:"bytes,2,opt,name=extend,proto3" json:"extend,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The response message containing the greetings
func (*Respond) Descriptor ¶
func (*Respond) ProtoMessage ¶
func (*Respond) ProtoMessage()
func (*Respond) XXX_DiscardUnknown ¶
func (m *Respond) XXX_DiscardUnknown()
func (*Respond) XXX_Marshal ¶
func (*Respond) XXX_Unmarshal ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
This following code was generated by tarsrpc Gernerated from protocol.proto
func (*Server) AddServant ¶
AddServant is required by the servant interface
func (*Server) Dispatch ¶
func (obj *Server) Dispatch(ctx context.Context, val interface{}, req *requestf.RequestPacket, resp *requestf.ResponsePacket, withContext bool) (err error)
Dispatch is used to call the user implement of the defined method.
func (*Server) SetServant ¶
SetServant is required by the servant interface.
func (*Server) TarsSetTimeout ¶
TarsSetTimeout is required by the servant interface. t is the timeout in ms.
type StApp ¶
type StApp struct { Id uint32 `json:"id,omitempty"` Name string `json:"name,omitempty"` Server []StServer `json:"server,omitempty"` Secret string `json:"secret,omitempty"` RouteType int `json:"routeType,omitempty"` Switch uint32 `json:"switch,omitempty"` //1开启服务 BlackList []string `json:"blackList,omitempty"` // WhiteList []string `json:"whiteList,omitempty"` // GatewayObject string `json:"gatewayObject,omitempty"` }
type StServer ¶
type StServer struct { Id uint32 `json:"id,omitempty"` Name string `json:"name,omitempty"` RouteType int `json:"routeType,omitempty"` Switch uint32 `json:"switch,omitempty"` //1开启服务 Secret string `json:"secret,omitempty"` BlackList []string `json:"blackList,omitempty"` // WhiteList []string `json:"whiteList,omitempty"` // }
type StTarsHttpProxy ¶
type StTarsHttpProxy struct { *StTarsHttpProxyCommon RouteId uint64 // contains filtered or unexported fields }
func (*StTarsHttpProxy) InitProxyHTTP ¶
func (*StTarsHttpProxy) ReloadConf ¶
func (h *StTarsHttpProxy) ReloadConf() (err error)
func (*StTarsHttpProxy) ServeHTTP ¶
func (h *StTarsHttpProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (err error)
实现Handler的接口
type StTarsHttpProxyCommon ¶
type StTarsHttpProxyCommon struct { *StTarsProxy // contains filtered or unexported fields }
type StTarsProxy ¶
type StTarsProxy struct { Secret string `json:"secret,omitempty"` RouteType int `json:"routeType,omitempty"` App []StApp `json:"app,omitempty"` LimitObj string `json:"limitObj,omitempty"` RouteId uint64 // contains filtered or unexported fields }
func (*StTarsProxy) InitProxy ¶
func (info *StTarsProxy) InitProxy(key string) (err error)
type StTarsProxyTcpCommon ¶
type StTarsProxyTcpCommon struct { *StTarsProxy // contains filtered or unexported fields }
func (*StTarsProxyTcpCommon) InitProxy ¶
func (info *StTarsProxyTcpCommon) InitProxy(key string) (err error)
type StTarsTcpProxy ¶
type StTarsTcpProxy struct { *StTarsProxyTcpCommon RouteId uint64 // contains filtered or unexported fields }
func (*StTarsTcpProxy) Close ¶
func (outInfo *StTarsTcpProxy) Close(info interface{})
func (*StTarsTcpProxy) Handle ¶
func (outInfo *StTarsTcpProxy) Handle(info, reqHead, reqBody interface{}) (outHeadRsp []byte, err error)
func (*StTarsTcpProxy) HandlePre ¶
func (outInfo *StTarsTcpProxy) HandlePre(info, reqHead, reqBody interface{}) (limitObj string, reqHeadOut, reqBodyOut interface{}, err error)
func (*StTarsTcpProxy) InitProxy ¶
func (outInfo *StTarsTcpProxy) InitProxy(key string) (err error)
func (*StTarsTcpProxy) IsExit ¶
func (outInfo *StTarsTcpProxy) IsExit(info interface{}) int
func (*StTarsTcpProxy) ReloadConf ¶
func (outInfo *StTarsTcpProxy) ReloadConf() (err error)
func (*StTarsTcpProxy) TcpProxyGet ¶
func (outInfo *StTarsTcpProxy) TcpProxyGet(ip string) interface{}
func (*StTarsTcpProxy) Verify ¶
func (outInfo *StTarsTcpProxy) Verify(info interface{}) error
Click to show internal directories.
Click to hide internal directories.