message

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// STATUS_NEW a new message
	STATUS_NEW = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlterTable

type AlterTable struct {
}

AlterTable for mysql ddl

type Content

type Content struct {
	Head *Head       `json:"head"`
	Data interface{} `json:"data"`
}

Content of Message

type CreateTable

type CreateTable struct {
}

CreateTable for mysql ddl

type Delete

type Delete struct {
	Old map[string]interface{} `json:"old"`
}

Delete for mysql delete

type Head struct {
	Type     string             `json:"type"`
	Time     uint32             `json:"time"`
	Database string             `json:"database"`
	Table    string             `json:"table"`
	Position *pipeline.Position `json:"position"`
}

Head of Message

type Insert

type Insert struct {
	New map[string]interface{} `json:"new"`
}

Insert for mysql insert

type Message

type Message struct {
	Status         int16
	Filter         bool
	BinlogPosition *pipeline.Position
	Content        *Content
}

Message basic message for pipeline handle

func New

func New() *Message

New return a new message

func (*Message) Json

func (msg *Message) Json() (string, error)

Json marshal message to json data

func (*Message) JsonContent

func (msg *Message) JsonContent() (string, error)

JsonContent only marshal message's content to josn data

func (*Message) ToString

func (msg *Message) ToString() string

ToString returns message's string data

type MessageType

type MessageType byte

MessageType for pipeline handle

var (
	TYPE_EMPTY        MessageType = 0
	TYPE_INSERT       MessageType = 1
	TYPE_UPDATE       MessageType = 2
	TYPE_DELETE       MessageType = 3
	TYPE_CREATE_TABLE MessageType = 4
	TYPE_ALTER_TABLE  MessageType = 5
)

func (MessageType) String

func (mt MessageType) String() string

String returns MessageType's string

type STATUS

type STATUS int16

STATUS for message control

type Update

type Update struct {
	Old map[string]interface{} `json:"old"`
	New map[string]interface{} `json:"new"`
}

Update for mysql update

Jump to

Keyboard shortcuts

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