forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 1
/
stream_event.go
32 lines (24 loc) · 831 Bytes
/
stream_event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proto
import (
mproto "github.com/youtube/vitess/go/mysql/proto"
"github.com/youtube/vitess/go/sqltypes"
)
// StreamEvent represents one event for the update stream.
type StreamEvent struct {
// Category can be "DML", "DDL", "ERR" or "POS"
Category string
// TableName, PrimaryKeyFields and PrimaryKeyValues are set for DML
TableName string
PrimaryKeyFields []mproto.Field
PrimaryKeyValues [][]sqltypes.Value
// Sql is set for DDL or ERR
Sql string
// Timestamp is set for DML, DDL or ERR
Timestamp int64
// TransactionID is set for POS
TransactionID string
}
//go:generate bsongen -file $GOFILE -type StreamEvent -o stream_event_bson.go