proto

package
v0.0.0-...-685946b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2013 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BL_UNRECOGNIZED = iota
	BL_BEGIN
	BL_COMMIT
	BL_ROLLBACK
	BL_DML
	BL_DDL
	BL_SET
)

Valid statement types in the binlogs.

Variables

This section is empty.

Functions

func MarshalPKRowBson

func MarshalPKRowBson(buf *bytes2.ChunkedWriter, key string, pkRow []interface{})

func MarshalPKValuesBson

func MarshalPKValuesBson(buf *bytes2.ChunkedWriter, key string, pkValues [][]interface{})

func MarshalStatementsBson

func MarshalStatementsBson(buf *bytes2.ChunkedWriter, key string, statements []Statement)

func RegisterAuthenticated

func RegisterAuthenticated(service UpdateStream)

RegisterAuthenticated registers a variable that satisfies the UpdateStream interface as an rpc service that requires authentication.

func UnmarshalPKRowBson

func UnmarshalPKRowBson(buf *bytes.Buffer, kind byte) []interface{}

func UnmarshalPKValuesBson

func UnmarshalPKValuesBson(buf *bytes.Buffer, kind byte) [][]interface{}

Types

type BinlogTransaction

type BinlogTransaction struct {
	Statements []Statement
	GroupId    string
}

BinlogTransaction represents one transaction as read from the binlog.

func (*BinlogTransaction) MarshalBson

func (blt *BinlogTransaction) MarshalBson(buf *bytes2.ChunkedWriter)

func (*BinlogTransaction) UnmarshalBson

func (blt *BinlogTransaction) UnmarshalBson(buf *bytes.Buffer)

type KeyrangeRequest

type KeyrangeRequest struct {
	GroupId  string
	Keyrange key.KeyRange
}

KeyrangeRequest is used to make a request for StreamKeyrange.

type Statement

type Statement struct {
	Category int
	Sql      []byte
}

Statement represents one statement as read from the binlog.

func UnmarshalStatementsBson

func UnmarshalStatementsBson(buf *bytes.Buffer, kind byte) []Statement

func (*Statement) MarshalBson

func (stmt *Statement) MarshalBson(buf *bytes2.ChunkedWriter)

func (*Statement) UnmarshalBson

func (stmt *Statement) UnmarshalBson(buf *bytes.Buffer)

type StreamEvent

type StreamEvent struct {
	// Category can be "DML", "DDL", "ERR" or "POS"
	Category string

	// DML
	TableName  string
	PKColNames []string
	PKValues   [][]interface{}

	// DDL or ERR
	Sql string

	// Timestamp is set for DML, DDL or ERR
	Timestamp int64

	// POS
	GroupId string
}

StreamEvent represents one event for the update stream.

func (*StreamEvent) MarshalBson

func (ste *StreamEvent) MarshalBson(buf *bytes2.ChunkedWriter)

func (*StreamEvent) UnmarshalBson

func (ste *StreamEvent) UnmarshalBson(buf *bytes.Buffer)

type UpdateStream

type UpdateStream interface {
	ServeUpdateStream(req *UpdateStreamRequest, sendReply func(reply interface{}) error) (err error)
	StreamKeyrange(req *KeyrangeRequest, sendReply func(reply interface{}) error) (err error)
}

UpdateStream defines the rpc API for the update stream service.

type UpdateStreamRequest

type UpdateStreamRequest struct {
	GroupId string
}

UpdateStreamRequest is used to make a request for ServeUpdateStream.

Jump to

Keyboard shortcuts

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