Documentation ¶
Index ¶
Constants ¶
View Source
const ( // STATUS_NEW a new message STATUS_NEW = iota // STATUS_SEND message has be sended STATUS_SEND // STATUS_RECORD message has be recorded STATUS_RECORD )
Variables ¶
View Source
var Pool = sync.Pool{ New: func() interface{} { return &Message{} }, }
Pool reuse message object
Functions ¶
Types ¶
type Content ¶
type Content struct { Head Head `json:"head"` Data interface{} `json:"data"` }
Content of Message
type Delete ¶
type Delete struct {
Old map[string]interface{} `json:"old"`
}
Delete for mysql delete
type Head ¶
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 ¶
Message basic message for pipeline handle
func (*Message) JsonContent ¶
JsonContent only marshal message's content to josn 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
Click to show internal directories.
Click to hide internal directories.