stdout

package
v0.0.0-...-64b8ef3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpType_Rotate OperationType = "rotate"
	OpType_Gtid                 = "gtid"
	OpType_Begin                = "begin"
	OpType_Commit               = "commit"
	OpType_Insert               = "insert"
	OpType_Update               = "update"
	OpType_Delete               = "delete"
	OpType_Query                = "query"
	OpType_DDL                  = "ddl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name      string           `json:"name"`
	SqlType   string           `json:"sql_type"`
	InnerType byte             `json:"inner_type"`
	Unsigned  bool             `json:"unsigned"`
	Key       schema.IndexType `json:"key"`
	Charset   string           `json:"charset"`
}

type Config

type Config struct {
	Encoder string `toml:"encoder"`
}

type Operation

type Operation struct {
	Header *OperationHeader `json:"header"`

	// NextLogName and NextLogPos field is for Rotate operation
	NextLogName string `json:"next_log_name,omitempty"`
	NextLogPos  uint32 `json:"next_log_pos,omitempty"`

	// Gtid field is for GTID operation
	Gtid string `json:"gtid,omitempty"`

	// Database and Statement filed is for QUERY/DDL operation
	Database  string `json:"database,omitempty"`
	Statement string `json:"statement,omitempty"`

	// Table and Rows field is for INSERT/UPDATE/DELETE operation
	Table *Table `json:"table,omitempty"`
	Rows  []*Row `json:"rows,omitempty"`

	// Progress field is for COMMIT/DDL operation,
	// represents the GTID_SET or file&pos
	Progress *Progress `json:"progress,omitempty"`
	// contains filtered or unexported fields
}

type OperationHeader

type OperationHeader struct {
	ServerID  uint32        `json:"server_id"`
	Type      OperationType `json:"type"`
	Timestamp uint32        `json:"timestamp"`
	LogPos    uint32        `json:"log_pos"`
}

type OperationType

type OperationType string

type Progress

type Progress struct {
	Flavor   string `json:"flavor"`
	ServerID uint32 `json:"server_id"`
	LogName  string `json:"log_name"`
	LogPos   uint32 `json:"log_pos"`
	Gset     string `json:"gset"`
}

type Row

type Row struct {
	Before []interface{} `json:"before,omitempty"`
	After  []interface{} `json:"after,omitempty"`
}

type StdoutSink

type StdoutSink struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*StdoutSink) Checkpoint

func (o *StdoutSink) Checkpoint() *ckp.Checkpoint

func (*StdoutSink) Close

func (o *StdoutSink) Close() error

func (*StdoutSink) Err

func (o *StdoutSink) Err() <-chan error

func (*StdoutSink) Initialize

func (o *StdoutSink) Initialize(ctx context.Context, ckp *ckp.Checkpoint) error

func (*StdoutSink) OnBegin

func (o *StdoutSink) OnBegin(h *replication.EventHeader) error

func (*StdoutSink) OnCommit

func (o *StdoutSink) OnCommit(h *replication.EventHeader, progress prog.Progress) error

func (*StdoutSink) OnDDL

func (*StdoutSink) OnGTID

func (*StdoutSink) OnQuery

func (*StdoutSink) OnRotate

func (*StdoutSink) OnRow

func (*StdoutSink) String

func (o *StdoutSink) String() string

type Table

type Table struct {
	Database string    `json:"database"`
	Name     string    `json:"name"`
	Columns  []*Column `json:"columns"`
}

Jump to

Keyboard shortcuts

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