model

package
v0.0.0-...-c6e60ff Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package model defines data structure that is shared across different categories of plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes []byte

func (Bytes) Encode

func (b Bytes) Encode() ([]byte, error)

func (Bytes) Length

func (b Bytes) Length() int

func (Bytes) String

func (b Bytes) String() string

type ConsumerMessage

type ConsumerMessage struct {
	*sarama.ConsumerMessage
}

ConsumerMessage is a kafka consumer messsage that is also a payloader.

func (ConsumerMessage) Encode

func (m ConsumerMessage) Encode() ([]byte, error)

func (ConsumerMessage) Length

func (m ConsumerMessage) Length() int

type RowsEvent

type RowsEvent struct {
	Log           string `json:"log"`
	Position      uint32 `json:"pos"`
	Schema        string `json:"db"`
	Table         string `json:"tbl"`
	Action        string `json:"dml"`
	Timestamp     uint32 `json:"ts"` // timestamp of binlog from master
	DbusTimestamp int64  `json:"dt"` // timestamp of dbus receiving the binlog

	Columns []string `json:"cols"` // column names

	// binlog has three update event version, v0, v1 and v2.
	// for v1 and v2, the rows number must be even.
	// Two rows for one event, format is [before update row, after update row]
	// for update v0, only one row for a event, and we don't support this version.
	Rows [][]interface{} `json:"rows"`
	// contains filtered or unexported fields
}

RowsEvent is a structured mysql binlog rows event. It implements engine.Payloader interface and can be transferred between plugins. It also implements kafka message value interface and can be produced to kafka.

func (*RowsEvent) Encode

func (r *RowsEvent) Encode() (b []byte, err error)

Encode implements engine.Payloader and sarama.Encoder.

func (*RowsEvent) IsStmtEnd

func (r *RowsEvent) IsStmtEnd() bool

func (*RowsEvent) Length

func (r *RowsEvent) Length() int

Length implements engine.Payloader and sarama.Encoder.

func (*RowsEvent) MetaInfo

func (r *RowsEvent) MetaInfo() string

func (*RowsEvent) SetFlags

func (r *RowsEvent) SetFlags(flag uint16) *RowsEvent

func (*RowsEvent) String

func (r *RowsEvent) String() string

Used for debugging.

type String

type String string

func (String) Encode

func (s String) Encode() ([]byte, error)

func (String) Length

func (s String) Length() int

func (String) String

func (s String) String() string

Jump to

Keyboard shortcuts

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