recording

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Recorders = []Recorder{}

Recorders Recorders

View Source
var ShouldRecordAction = func(action Action) bool {
	return true
}

ShouldRecordAction ShouldRecordAction

Functions

func EncodeAnyByteArray

func EncodeAnyByteArray(s []byte) json.RawMessage

EncodeAnyByteArray custom Marshal

Types

type Action

type Action interface {
	GetActionIndex() int
	GetOccurredAt() int64
	GetActionType() string
}

Action Action

type AppendFile

type AppendFile struct {
	FileName string
	Content  []byte
	// contains filtered or unexported fields
}

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

type AsyncRecorder struct {
	Context context.Context
	// contains filtered or unexported fields
}

AsyncRecorder AsyncRecorder

func NewAsyncRecorder

func NewAsyncRecorder(realRecorder Recorder) *AsyncRecorder

NewAsyncRecorder NewAsyncRecorder

func (*AsyncRecorder) Record

func (recorder *AsyncRecorder) Record(session *Session)

Record Record

func (*AsyncRecorder) Start

func (recorder *AsyncRecorder) Start()

Start Start

type CallFromInbound

type CallFromInbound struct {
	Peer     net.TCPAddr
	Request  []byte
	UnixAddr net.UnixAddr
	// contains filtered or unexported fields
}

CallFromInbound Inbound Request

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 `json:"CSpanId"`
	// contains filtered or unexported fields
}

CallOutbound Outbound Request and Response

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 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 Recorder

type Recorder interface {
	Record(session *Session)
}

Recorder Recorder

type ReturnInbound

type ReturnInbound struct {
	Response []byte
	// contains filtered or unexported fields
}

ReturnInbound Inbound Response

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

type SendUDP struct {
	Peer    net.UDPAddr
	Content []byte
	// contains filtered or unexported fields
}

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

func (sendUDP *SendUDP) MarshalJSON() ([]byte, error)

MarshalJSON MarshalJSON

type Session

type Session struct {
	Context         string           `json:"Context"`
	SessionID       string           `json:"SessionId"`
	ThreadID        int32            `json:"ThreadId"`
	TraceHeader     TraceHeader      `json:"TraceHeader"`
	TraceID         []byte           `json:"TraceId"`
	SpanID          []byte           `json:"SpanId"`
	NextSessionID   string           `json:"NextSessionId"`
	CallFromInbound *CallFromInbound `json:"CallFromInbound"`
	ReturnInbound   *ReturnInbound   `json:"ReturnInbound"`
	Actions         []Action         `json:"Actions"`
	// contains filtered or unexported fields
}

Session Session

func NewSession

func NewSession(threadID int32) *Session

NewSession NewSession

func (*Session) AppendFile

func (session *Session) AppendFile(ctx context.Context, content []byte, fileName string)

AppendFile AppendFile

func (*Session) HasRequest

func (session *Session) HasRequest() bool

HasRequest has Request

func (*Session) HasResponse added in v0.0.7

func (session *Session) HasResponse() bool

HasResponse has Response

func (*Session) MarshalJSON

func (session *Session) MarshalJSON() ([]byte, error)

MarshalJSON MarshalJSON

func (*Session) ReadStorage

func (session *Session) ReadStorage(ctx context.Context, span []byte)

ReadStorage ReadStorage

func (*Session) RecvFromInbound

func (session *Session) RecvFromInbound(ctx context.Context, span []byte, peer net.TCPAddr, unix net.UnixAddr)

RecvFromInbound Inbound Request

func (*Session) RecvFromOutbound

func (session *Session) RecvFromOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, socketFD int)

RecvFromOutbound Outbound Response

func (*Session) SendToInbound

func (session *Session) SendToInbound(ctx context.Context, span []byte, peer net.TCPAddr)

SendToInbound Inbound Response

func (*Session) SendToOutbound

func (session *Session) SendToOutbound(ctx context.Context, span []byte, peer net.TCPAddr, local *net.TCPAddr, socketFD int)

SendToOutbound Outbound TCP Request

func (*Session) SendUDPToOutbound

func (session *Session) SendUDPToOutbound(ctx context.Context, span []byte, peer net.UDPAddr)

SendUDPToOutbound Outbound UDP Request

func (*Session) Shutdown

func (session *Session) Shutdown(ctx context.Context, newSession *Session)

Shutdown shotdown and recorder

func (*Session) Summary

func (session *Session) Summary(newSession *Session)

Summary sunmmary

type TraceHeader

type TraceHeader []byte

TraceHeader TraceHeader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL