Documentation
¶
Overview ¶
Package decode turns "msg" events of a wire trace into logical messages: containers are split, wrappers (invokeWithLayer, initConnection, invokeAfterMsg, ...) are unwrapped, rpc_result is joined with its request (method, latency, request id and caller).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caller ¶
type Caller struct {
File string `json:"file,omitempty"`
Line int64 `json:"line,omitempty"`
Function string `json:"function,omitempty"`
Subsystem string `json:"subsystem,omitempty"`
}
Caller is the call site of a request (req.caller).
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes "msg" events into logical messages.
Feed every event to Index first (pass 1), then call Messages for "msg" events (pass 2). Index collects facts that may be written after the message they describe (req.caller is emitted from another thread).
type Message ¶
type Message struct {
Seq uint64 `json:"seq"`
T float64 `json:"t"`
Dir string `json:"dir"`
SDC int `json:"sdc"`
Session string `json:"session"`
MsgID string `json:"msg_id"`
SeqNo int64 `json:"seqno"`
Container string `json:"container,omitempty"`
Gzip bool `json:"gzip,omitempty"`
Wrap []string `json:"wrap,omitempty"`
// After is the target msg_id of invokeAfterMsg(s) (the last one).
After string `json:"after,omitempty"`
AfterMethod string `json:"after_method,omitempty"`
// Type is the constructor (or function) of the message body.
Type string `json:"type"`
// Method is the innermost method of an outgoing query, or the method of
// the request an rpc_result answers.
Method string `json:"method,omitempty"`
Req int64 `json:"req,omitempty"`
Caller *Caller `json:"caller,omitempty"`
// ReqMsgID, Result, LatencyMS and Error are set for rpc_result.
ReqMsgID string `json:"req_msg_id,omitempty"`
Result string `json:"result,omitempty"`
LatencyMS *float64 `json:"latency_ms,omitempty"`
Error *RPCError `json:"error,omitempty"`
Redacted []string `json:"redacted,omitempty"`
Partial bool `json:"partial,omitempty"`
DecodeError string `json:"decode_error,omitempty"`
Body any `json:"body"`
// MsgIDValue is the numeric MsgID.
MsgIDValue uint64 `json:"-"`
// TypeID is the constructor id of the body (after gzip).
TypeID uint32 `json:"-"`
// MethodID is the id of Method, if known.
MethodID uint32 `json:"-"`
}
Message is one logical MTProto message.
Click to show internal directories.
Click to hide internal directories.