writer

package
v1.0.4-hotfix-2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWriter

type FileWriter struct {
	// contains filtered or unexported fields
}

FileWriter is a binlog event writer which writes binlog events to a file.

func (*FileWriter) Close

func (w *FileWriter) Close() error

Close implements Writer.Close.

func (*FileWriter) Flush

func (w *FileWriter) Flush() error

Flush implements Writer.Flush.

func (*FileWriter) Start

func (w *FileWriter) Start() error

Start implements Writer.Start.

func (*FileWriter) Status

func (w *FileWriter) Status() interface{}

Status implements Writer.Status.

func (*FileWriter) Write

func (w *FileWriter) Write(rawData []byte) error

Write implements Writer.Write.

type FileWriterConfig

type FileWriterConfig struct {
	Filename string
}

FileWriterConfig is the configuration used by a FileWriter.

type FileWriterStatus

type FileWriterStatus struct {
	Stage    string `json:"stage"`
	Filename string `json:"filename"`
	Offset   int64  `json:"offset"`
}

FileWriterStatus represents the status of a FileWriter.

func (*FileWriterStatus) String

func (s *FileWriterStatus) String() string

String implements Stringer.String.

type Writer

type Writer interface {
	// Start prepares the writer for writing binlog events.
	Start() error

	// Close closes the writer and release the resource.
	Close() error

	// Write writes/appends a binlog event's rawData.
	Write(rawData []byte) error

	// Flush flushes the buffered data to a stable storage or sends through the network.
	Flush() error

	// Status returns the status of the writer.
	Status() interface{}
}

Writer is a binlog event writer, it may write binlog events to a binlog file, an in-memory structure or a TCP stream.

func NewFileWriter

func NewFileWriter(tctx *tcontext.Context, cfg *FileWriterConfig) Writer

NewFileWriter creates a FileWriter instance.

Jump to

Keyboard shortcuts

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