capture

package
v1.4.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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
	EncryptionMethod string
	KeyFile          string
	// It's specified when executing with the statement `TRAFFIC CAPTURE` so that all TiProxy instances
	// use the same start time and the time acts as the job ID.
	StartTime time.Time
	Duration  time.Duration
	Compress  bool
	// contains filtered or unexported fields
}

func (*CaptureConfig) Validate

func (cfg *CaptureConfig) Validate() (storage.ExternalStorage, error)

Jump to

Keyboard shortcuts

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