handler

package
v0.0.0-...-3491b9c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpdateAction = "update"
	InsertAction = "insert"
	DeleteAction = "delete"
)

Variables

This section is empty.

Functions

func GetHashValue

func GetHashValue(row []interface{}, fields []string, objFieldName string) (hashValue uint64)

func Slice2Struct

func Slice2Struct(vList []interface{}, pb proto.Message) error

Types

type ArrayData

type ArrayData struct {
	Columns      []string      `json:"columns"`
	BeforeValues []interface{} `json:"before_values"`
	Values       []interface{} `json:"values"`
}

type BinlogEvent

type BinlogEvent struct {
	Schema    string `protobuf:"bytes,1,opt,name=schema" json:"schema,omitempty"`
	Table     string `protobuf:"bytes,2,opt,name=table" json:"table,omitempty"`
	Action    string `protobuf:"bytes,3,opt,name=action" json:"action,omitempty"`
	Timestamp uint32 `protobuf:"varint,4,opt,name=datetime" json:"datetime,omitempty"`
	//Pos       uint32      `protobuf:"varint,5,opt,name=pos" json:"pos,omitempty"`
	//EndLogPod uint64      `protobuf:"varint,6,opt,name=end_log_pod,json=endLogPod" json:"end_log_pod,omitempty"`
	Data interface{} `json:"data"`
}

type Config

type Config struct {
	PosStorage     storage.PosStorageConfig
	SerializerType int
	Endpoint       endpoints.Config
	// contains filtered or unexported fields
}

type EventHandler

type EventHandler struct {
	canal.DummyEventHandler
	// contains filtered or unexported fields
}

func NewEventHandler

func NewEventHandler(handlerCfg Config) *EventHandler

func (*EventHandler) OnPosSynced

func (h *EventHandler) OnPosSynced(pos mysql.Position, set mysql.GTIDSet, force bool) error

func (*EventHandler) OnRotate

func (h *EventHandler) OnRotate(ev *replication.RotateEvent) error

func (*EventHandler) OnRow

func (h *EventHandler) OnRow(e *canal.RowsEvent) (err error)

func (*EventHandler) String

func (h *EventHandler) String() string

type UpdateData

type UpdateData struct {
	BeforeValues interface{} `json:"before_values"`
	AfterValues  interface{} `json:"after_values"`
}

Jump to

Keyboard shortcuts

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