protocol

package
v0.0.0-...-a8497ec Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventAction

type EventAction string

mysql 操作类型

const (
	UpdateAction EventAction = "update"
	InsertAction EventAction = "insert"
	DeleteAction EventAction = "delete"
)

func (*EventAction) DecodeMsg

func (z *EventAction) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (EventAction) EncodeMsg

func (z EventAction) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (EventAction) MarshalMsg

func (z EventAction) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EventAction) Msgsize

func (z EventAction) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EventAction) UnmarshalMsg

func (z *EventAction) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EventData

type EventData struct {
	Action  EventAction
	Schema  string
	Table   string
	Columns []string
	//如果是update, Rows[i]是更新前的数据, Rows[i+1]是更新后的数据
	Rows  [][]interface{}
	Owner TopicInfo `msg:"-"`
}

func (*EventData) DecodeMsg

func (z *EventData) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*EventData) Encode

func (p *EventData) Encode() ([]byte, error)

func (*EventData) EncodeMsg

func (z *EventData) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*EventData) GetAction

func (p *EventData) GetAction() string

func (*EventData) GetSchemal

func (p *EventData) GetSchemal() string

func (*EventData) GetTable

func (p *EventData) GetTable() string

func (*EventData) Length

func (p *EventData) Length() int

func (*EventData) MarshalMsg

func (z *EventData) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EventData) Msgsize

func (z *EventData) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EventData) ToJsonArrary

func (p *EventData) ToJsonArrary() (string, error)

func (*EventData) ToObjArrary

func (p *EventData) ToObjArrary(container interface{}) error

func (*EventData) UnmarshalMsg

func (z *EventData) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TopicInfo

type TopicInfo struct {
	Topic    string
	Key      string
	KeyIndex int
}

func (*TopicInfo) DecodeMsg

func (z *TopicInfo) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (TopicInfo) EncodeMsg

func (z TopicInfo) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (TopicInfo) MarshalMsg

func (z TopicInfo) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (TopicInfo) Msgsize

func (z TopicInfo) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TopicInfo) UnmarshalMsg

func (z *TopicInfo) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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