Documentation ¶
Index ¶
- Variables
- func EncodeAnyByteArray(s []byte) json.RawMessage
- func UnzipHttpRepsonse(data []byte) []byte
- type Action
- type AppendFile
- type AsyncRecorder
- type CallFromInbound
- type CallOutbound
- type ID
- func (id ID) Counter() int32
- func (id ID) Machine() []byte
- func (id ID) MarshalText() ([]byte, error)
- func (id ID) Pid() uint16
- func (id *ID) Scan(value interface{}) (err error)
- func (id ID) String() string
- func (id ID) Time() time.Time
- func (id *ID) UnmarshalText(text []byte) error
- func (id ID) Value() (driver.Value, error)
- type ReadStorage
- type Recorder
- type ReturnInbound
- type SendUDP
- type Session
- func (session *Session) AppendFile(ctx context.Context, content []byte, fileName string)
- func (session *Session) HasRequest() bool
- func (session *Session) HasResponded() bool
- func (session *Session) MarshalJSON() ([]byte, error)
- func (session *Session) ReadStorage(ctx context.Context, span []byte)
- func (session *Session) RecvFromInbound(ctx context.Context, span []byte, peer net.TCPAddr, unix net.UnixAddr)
- func (session *Session) RecvFromOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, ...)
- func (session *Session) SendToInbound(ctx context.Context, span []byte, peer net.TCPAddr)
- func (session *Session) SendToOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, ...)
- func (session *Session) SendUDPToOutbound(ctx context.Context, span []byte, peer net.UDPAddr)
- func (session *Session) Shutdown(ctx context.Context, newSession *Session)
- func (session *Session) Summary(newSession *Session)
- type TraceHeader
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidID = errors.New("xid: invalid ID")
ErrInvalidID is returned when trying to unmarshal an invalid ID
var Recorders = []Recorder{}
Recorders Recorders
var ShouldRecordAction = func(action Action) bool { return true }
ShouldRecordAction ShouldRecordAction
Functions ¶
func EncodeAnyByteArray ¶
func EncodeAnyByteArray(s []byte) json.RawMessage
Types ¶
type AppendFile ¶
AppendFile AppendFile
func (*AppendFile) GetActionIndex ¶
func (action *AppendFile) GetActionIndex() int
func (*AppendFile) GetActionType ¶
func (action *AppendFile) GetActionType() string
func (*AppendFile) GetOccurredAt ¶
func (action *AppendFile) GetOccurredAt() int64
func (*AppendFile) MarshalJSON ¶
func (appendFile *AppendFile) MarshalJSON() ([]byte, error)
MarshalJSON MarshalJSON
type AsyncRecorder ¶
AsyncRecorder AsyncRecorder
func NewAsyncRecorder ¶
func NewAsyncRecorder(realRecorder Recorder) *AsyncRecorder
NewAsyncRecorder NewAsyncRecorder
func (*AsyncRecorder) Record ¶
func (recorder *AsyncRecorder) Record(session *Session)
Record Record
type CallFromInbound ¶
type CallFromInbound struct { Peer net.TCPAddr Request []byte UnixAddr net.UnixAddr // contains filtered or unexported fields }
CallFromInbound Inbound请求
func (*CallFromInbound) GetActionIndex ¶
func (action *CallFromInbound) GetActionIndex() int
func (*CallFromInbound) GetActionType ¶
func (action *CallFromInbound) GetActionType() string
func (*CallFromInbound) GetOccurredAt ¶
func (action *CallFromInbound) GetOccurredAt() int64
func (*CallFromInbound) MarshalJSON ¶
func (callFromInbound *CallFromInbound) MarshalJSON() ([]byte, error)
MarshalJSON MarshalJSON
type CallOutbound ¶
type CallOutbound struct { SocketFD int Peer net.TCPAddr Local *net.TCPAddr `json:"-"` Request []byte ResponseTime int64 Response []byte UnixAddr net.UnixAddr CSpanId []byte // contains filtered or unexported fields }
CallOutbound Outbound请求和返回
func (*CallOutbound) GetActionIndex ¶
func (action *CallOutbound) GetActionIndex() int
func (*CallOutbound) GetActionType ¶
func (action *CallOutbound) GetActionType() string
func (*CallOutbound) GetOccurredAt ¶
func (action *CallOutbound) GetOccurredAt() int64
func (*CallOutbound) MarshalJSON ¶
func (callOutbound *CallOutbound) MarshalJSON() ([]byte, error)
MarshalJSON MarshalJSON
type ID ¶
type ID [rawLen]byte
ID represents a unique request id
func FromString ¶
FromString reads an ID from its string representation
func (ID) Counter ¶
Counter returns the incrementing value part of the id. It's a runtime error to call this method with an invalid id.
func (ID) Machine ¶
Machine returns the 3-byte machine id part of the id. It's a runtime error to call this method with an invalid id.
func (ID) MarshalText ¶
MarshalText implements encoding/text TextMarshaler interface
func (ID) Pid ¶
Pid returns the process id part of the id. It's a runtime error to call this method with an invalid id.
func (ID) String ¶
String returns a base32 hex lowercased with no padding representation of the id (char set is 0-9, a-v).
func (ID) Time ¶
Time returns the timestamp part of the id. It's a runtime error to call this method with an invalid id.
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding/text TextUnmarshaler interface
type ReadStorage ¶
type ReadStorage struct { Content []byte // contains filtered or unexported fields }
ReadStorage ReadStorage
func (*ReadStorage) GetActionIndex ¶
func (action *ReadStorage) GetActionIndex() int
func (*ReadStorage) GetActionType ¶
func (action *ReadStorage) GetActionType() string
func (*ReadStorage) GetOccurredAt ¶
func (action *ReadStorage) GetOccurredAt() int64
func (*ReadStorage) MarshalJSON ¶
func (readStorage *ReadStorage) MarshalJSON() ([]byte, error)
MarshalJSON MarshalJSON
type ReturnInbound ¶
type ReturnInbound struct { Response []byte // contains filtered or unexported fields }
ReturnInbound Inbound返回
func (*ReturnInbound) GetActionIndex ¶
func (action *ReturnInbound) GetActionIndex() int
func (*ReturnInbound) GetActionType ¶
func (action *ReturnInbound) GetActionType() string
func (*ReturnInbound) GetOccurredAt ¶
func (action *ReturnInbound) GetOccurredAt() int64
func (*ReturnInbound) MarshalJSON ¶
func (returnInbound *ReturnInbound) MarshalJSON() ([]byte, error)
MarshalJSON MarshalJSON
type SendUDP ¶
SendUDP SendUDP
func (*SendUDP) GetActionIndex ¶
func (action *SendUDP) GetActionIndex() int
func (*SendUDP) GetActionType ¶
func (action *SendUDP) GetActionType() string
func (*SendUDP) GetOccurredAt ¶
func (action *SendUDP) GetOccurredAt() int64
func (*SendUDP) MarshalJSON ¶
MarshalJSON MarshalJSON
type Session ¶
type Session struct { Context string SessionId string ThreadId int32 TraceHeader TraceHeader TraceId []byte SpanId []byte NextSessionId string CallFromInbound *CallFromInbound ReturnInbound *ReturnInbound Actions []Action // contains filtered or unexported fields }
Session Session
func (*Session) AppendFile ¶
AppendFile AppendFile
func (*Session) MarshalJSON ¶
MarshalJSON MarshalJSON
func (*Session) ReadStorage ¶
ReadStorage ReadStorage
func (*Session) RecvFromInbound ¶
func (session *Session) RecvFromInbound(ctx context.Context, span []byte, peer net.TCPAddr, unix net.UnixAddr)
RecvFromInbound Inbound请求
func (*Session) RecvFromOutbound ¶
func (session *Session) RecvFromOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, socketFD int)
RecvFromOutbound Outbound返回
func (*Session) SendToInbound ¶
SendToInbound Inbound回复
func (*Session) SendToOutbound ¶
func (session *Session) SendToOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, socketFD int)
SendToOutbound OutboundTCP请求
func (*Session) SendUDPToOutbound ¶
SendUDPToOutbound Outbound的UDP请求
type TraceHeader ¶
type TraceHeader []byte