Documentation
¶
Index ¶
- Variables
- func ProtoMessage(req *Request, resp *Response) *pb.ProtoMessage
- type ProtoMatcher
- type ProtoParser
- type ProtoRequest
- type ProtoResponse
- type Request
- type Response
- type UnknownParser
- func (up *UnknownParser) EnableInferRequest() bool
- func (up *UnknownParser) EnableInferResponse() bool
- func (up *UnknownParser) ParseRequest(sockKey *types.SockKey, msg []byte) ([]ProtoRequest, error)
- func (up *UnknownParser) ParseResponse(sockKey *types.SockKey, msg []byte) ([]ProtoResponse, error)
- func (*UnknownParser) ProtoType() types.ProtocolType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotExistsHeader = errors.New("protocols: not exists header") ErrUnknownProtocolMsg = errors.New("protocols: unknown protocol msg") )
Functions ¶
func ProtoMessage ¶
func ProtoMessage(req *Request, resp *Response) *pb.ProtoMessage
Types ¶
type ProtoMatcher ¶
type ProtoMatcher interface { MatchRequest(req *Request) *pb.ProtoMessage MatchResponse(resp *Response) *pb.ProtoMessage }
type ProtoParser ¶
type ProtoParser interface { ProtoType() types.ProtocolType ParseRequest(sockKey *types.SockKey, msg []byte) ([]ProtoRequest, error) EnableInferRequest() bool ParseResponse(sockKey *types.SockKey, msg []byte) ([]ProtoResponse, error) EnableInferResponse() bool }
type ProtoRequest ¶
type ProtoRequest interface { ProtoType() types.ProtocolType Protobuf() *pb.Request }
type ProtoResponse ¶
type ProtoResponse interface { ProtoType() types.ProtocolType Protobuf() *pb.Response }
type Response ¶
type Response struct { Timestamp uint64 SockKey types.SockKey Record ProtoResponse }
type UnknownParser ¶
type UnknownParser struct {
// contains filtered or unexported fields
}
func NewUnknownParser ¶
func NewUnknownParser(parsers []ProtoParser) *UnknownParser
func (*UnknownParser) EnableInferRequest ¶
func (up *UnknownParser) EnableInferRequest() bool
func (*UnknownParser) EnableInferResponse ¶
func (up *UnknownParser) EnableInferResponse() bool
func (*UnknownParser) ParseRequest ¶
func (up *UnknownParser) ParseRequest(sockKey *types.SockKey, msg []byte) ([]ProtoRequest, error)
ParseRequest implements ProtoParser
func (*UnknownParser) ParseResponse ¶
func (up *UnknownParser) ParseResponse(sockKey *types.SockKey, msg []byte) ([]ProtoResponse, error)
ParseResponse implements ProtoParser
func (*UnknownParser) ProtoType ¶
func (*UnknownParser) ProtoType() types.ProtocolType
GetProtoType implements ProtoParser
Click to show internal directories.
Click to hide internal directories.