model

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChange added in v0.1.5

func GetChange(dd map[string]interface{}, op string) (vnewkeys map[string]interface{})

func IsChange added in v0.1.5

func IsChange(dd map[string]interface{}, op string, k string) (interface{}, bool)

change return true; not return false

func KeyExist added in v0.1.5

func KeyExist(dd map[string]interface{}, k string) (interface{}, bool)

func PutWalData

func PutWalData(data *WalData)

PutWalData putback data to pool

Types

type Operation

type Operation uint8

Operation type

const (
	// Insert operation
	Insert Operation = iota
	// Delete operation
	Delete
	// Update operation
	Update
	// Begin transaction
	Begin
	// Commit transaction
	Commit
	// Unknow operation
	Unknow
)

func (Operation) String

func (o Operation) String() string

type WalData

type WalData struct {
	OperationType Operation
	Schema        string
	Table         string
	Data          map[string]interface{}
	Timestamp     int64
	Pos           uint64
	Rule          *conf.Rule
}

WalData represent parsed wal log data

func NewWalData

func NewWalData() *WalData

NewWalData get data from pool

func Parse

func Parse(msg *pgx.WalMessage) (*WalData, error)

Parse test_decoding format wal to WalData

func ParseAll added in v0.2.0

func ParseAll(inByte []byte) (*WalData, error)

func (*WalData) Reset

func (d *WalData) Reset()

Reset for reuse

Jump to

Keyboard shortcuts

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