recorder

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RecorderServiceHandler       = "recorder.service.handler"
	RecorderServiceHandlerSerial = "recorder.service.handler.serial"
	RecorderServiceHandlerTunnel = "recorder.service.handler.tunnel"
)

Variables

This section is empty.

Functions

func FileRecorder

func FileRecorder(filename string, opts ...FileRecorderOption) recorder.Recorder

FileRecorder records data to file.

func HTTPRecorder

func HTTPRecorder(url string, opts ...HTTPRecorderOption) recorder.Recorder

HTTPRecorder records data to HTTP service.

func RedisListRecorder

func RedisListRecorder(addr string, opts ...RedisRecorderOption) recorder.Recorder

RedisListRecorder records data to a redis list.

func RedisSetRecorder

func RedisSetRecorder(addr string, opts ...RedisRecorderOption) recorder.Recorder

RedisSetRecorder records data to a redis set.

func RedisSortedSetRecorder

func RedisSortedSetRecorder(addr string, opts ...RedisRecorderOption) recorder.Recorder

RedisSortedSetRecorder records data to a redis sorted set.

func TCPRecorder

func TCPRecorder(addr string, opts ...TCPRecorderOption) recorder.Recorder

TCPRecorder records data to TCP service.

Types

type DNSRecorderObject added in v0.1.11

type DNSRecorderObject struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Class    string `json:"class"`
	Type     string `json:"type"`
	Question string `json:"question"`
	Answer   string `json:"answer"`
	Cached   bool   `json:"cached"`
}

type FileRecorderOption

type FileRecorderOption func(opts *fileRecorderOptions)

func SepRecorderOption

func SepRecorderOption(sep string) FileRecorderOption

type HTTPRecorderObject added in v0.1.11

type HTTPRecorderObject struct {
	Host       string                     `json:"host"`
	Method     string                     `json:"method"`
	Proto      string                     `json:"proto"`
	Scheme     string                     `json:"scheme"`
	URI        string                     `json:"uri"`
	StatusCode int                        `json:"statusCode"`
	Request    HTTPRequestRecorderObject  `json:"request"`
	Response   HTTPResponseRecorderObject `json:"response"`
}

type HTTPRecorderOption

type HTTPRecorderOption func(opts *httpRecorderOptions)

func HeaderHTTPRecorderOption added in v0.1.11

func HeaderHTTPRecorderOption(header http.Header) HTTPRecorderOption

func TimeoutHTTPRecorderOption

func TimeoutHTTPRecorderOption(timeout time.Duration) HTTPRecorderOption

type HTTPRequestRecorderObject added in v0.1.12

type HTTPRequestRecorderObject struct {
	ContentLength int64       `json:"contentLength"`
	Header        http.Header `json:"header"`
}

type HTTPResponseRecorderObject added in v0.1.12

type HTTPResponseRecorderObject struct {
	ContentLength int64       `json:"contentLength"`
	Header        http.Header `json:"header"`
}

type HandlerRecorderObject added in v0.1.11

type HandlerRecorderObject struct {
	Node       string              `json:"node,omitempty"`
	Service    string              `json:"service"`
	Network    string              `json:"network"`
	RemoteAddr string              `json:"remote"`
	LocalAddr  string              `json:"local"`
	Host       string              `json:"host"`
	ClientIP   string              `json:"clientIP"`
	ClientID   string              `json:"clientID,omitempty"`
	HTTP       *HTTPRecorderObject `json:"http,omitempty"`
	DNS        *DNSRecorderObject  `json:"dns,omitempty"`
	Err        string              `json:"err,omitempty"`
	Duration   time.Duration       `json:"duration"`
	Time       time.Time           `json:"time"`
	SID        string              `json:"sid"`
}

func (*HandlerRecorderObject) Record added in v0.1.11

type RedisRecorderOption

type RedisRecorderOption func(opts *redisRecorderOptions)

func DBRedisRecorderOption

func DBRedisRecorderOption(db int) RedisRecorderOption

func KeyRedisRecorderOption

func KeyRedisRecorderOption(key string) RedisRecorderOption

func PasswordRedisRecorderOption

func PasswordRedisRecorderOption(password string) RedisRecorderOption

type TCPRecorderOption

type TCPRecorderOption func(opts *tcpRecorderOptions)

func LogTCPRecorderOption added in v0.1.11

func LogTCPRecorderOption(log logger.Logger) TCPRecorderOption

func TimeoutTCPRecorderOption

func TimeoutTCPRecorderOption(timeout time.Duration) TCPRecorderOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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