proto

package
v0.0.0-...-7c5168d Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2013 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// contains all the statements of the given types
	DDL = "ddl"
	DML = "dml"

	// transation commands
	BEGIN  = "begin"
	COMMIT = "commit"

	// database selection
	USE = "use"
)

Possible values for SqlType (all lower case)

Variables

This section is empty.

Functions

func GetSqlType

func GetSqlType(firstKeyword string) string

GetSqlType returns one of the possible values for SqlType, or "" if it cannot be determined. firstKeyword has to be normalized to lower case first.

func RegisterBinlogServer

func RegisterBinlogServer(server BinlogServer)

RegisterBinlogServer makes sure the server implements the right API

Types

type BinlogData

type BinlogData struct {
	// SqlType is one of the possible constants defined earlier
	SqlType string

	// Sql is the list of statements executed
	Sql []string

	// KeyspaceId is used for routing of events
	KeyspaceId string
}

BinlogData is the payload for BinlogResponse

type BinlogPosition

type BinlogPosition struct {
	Position  ReplicationCoordinates
	Timestamp int64
	Xid       uint64
}

BinlogPosition keeps track of a server binlog position

func (*BinlogPosition) MarshalBson

func (pos *BinlogPosition) MarshalBson(buf *bytes2.ChunkedWriter)

func (*BinlogPosition) String

func (pos *BinlogPosition) String() string

func (*BinlogPosition) UnmarshalBson

func (pos *BinlogPosition) UnmarshalBson(buf *bytes.Buffer)

func (*BinlogPosition) Valid

func (pos *BinlogPosition) Valid() bool

type BinlogResponse

type BinlogResponse struct {
	Error    string
	Position BinlogPosition
	Data     BinlogData
}

BinlogResponse is the response from the BinlogServer service.

type BinlogServer

type BinlogServer interface {
	// ServeBinlog is the streaming API entry point.
	ServeBinlog(req *BinlogServerRequest, sendReply SendBinlogResponse) error
}

BinlogServer interface is used to validate the RPC syntax

type BinlogServerRequest

type BinlogServerRequest struct {
	StartPosition ReplicationCoordinates
	KeyRange      key.KeyRange
}

BinlogServerRequest represents a request to the BinlogServer service.

type ReplicationCoordinates

type ReplicationCoordinates struct {
	MasterFilename string
	MasterPosition uint64
	GroupId        string
}

ReplicationCoordinates keeps track of a server position.

func NewReplicationCoordinates

func NewReplicationCoordinates(masterFile string, masterPos uint64, groupId string) *ReplicationCoordinates

func (*ReplicationCoordinates) MarshalBson

func (repl *ReplicationCoordinates) MarshalBson(buf *bytes2.ChunkedWriter)

func (*ReplicationCoordinates) String

func (repl *ReplicationCoordinates) String() string

func (*ReplicationCoordinates) UnmarshalBson

func (repl *ReplicationCoordinates) UnmarshalBson(buf *bytes.Buffer)

type SendBinlogResponse

type SendBinlogResponse func(response interface{}) error

SendBinlogResponse makes it easier to define this interface

Jump to

Keyboard shortcuts

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