message

package
v1.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	STATUS_NEW = iota
)

Variables

This section is empty.

Functions

func Event

func Event()

Types

type AlterTable

type AlterTable struct {
}

type Content

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

type CreateTable

type CreateTable struct {
}

type Delete

type Delete struct {
	Old map[string]interface{} `json:"old"`
}
type Head struct {
	Type     string             `json:"type"`
	Time     uint32             `json:"time"`
	Database string             `json:"database"`
	Table    string             `json:"table"`
	Position *pipeline.Position `json:"position"`
}

type Insert

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

type Message

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

func New

func New() *Message

func (*Message) Json

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

func (*Message) JsonContent

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

func (*Message) ToString

func (msg *Message) ToString() string

type MessageType

type MessageType byte
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

type STATUS

type STATUS int16

type Update

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

Jump to

Keyboard shortcuts

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