capture

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSensitiveSQL

func IsSensitiveSQL(sql string) bool

func NewCapture

func NewCapture(lg *zap.Logger) *capture

Types

type Capture

type Capture interface {
	// Start starts the capture
	Start(cfg CaptureConfig) error
	// Stop stops the capture.
	// err means the error that caused the capture to stop. nil means the capture stopped manually.
	Stop(err error)
	// InitConn is called when a new connection is created.
	InitConn(startTime time.Time, connID uint64, db string)
	// Capture captures traffic
	Capture(packet []byte, startTime time.Time, connID uint64, initSession func() (string, error))
	// Progress returns the progress of the capture job
	Progress() (float64, time.Time, bool, error)
	// Close closes the capture
	Close()
}

type CaptureConfig

type CaptureConfig struct {
	Output   string
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*CaptureConfig) Validate

func (cfg *CaptureConfig) Validate() error

Jump to

Keyboard shortcuts

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