Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCapture ¶
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)
Click to show internal directories.
Click to hide internal directories.