forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 1
/
updatestream.go
29 lines (22 loc) · 1.09 KB
/
updatestream.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
// 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/vt/key"
pb "github.com/youtube/vitess/go/vt/proto/topodata"
)
// UpdateStream is the interface for the server
type UpdateStream interface {
// ServeUpdateStream serves the query and streams the result
// for the full update stream
ServeUpdateStream(position string, sendReply func(reply *StreamEvent) error) error
// StreamKeyRange streams events related to a KeyRange only
StreamKeyRange(position string, keyspaceIdType key.KeyspaceIdType, keyRange *pb.KeyRange, charset *mproto.Charset, sendReply func(reply *BinlogTransaction) error) error
// StreamTables streams events related to a set of Tables only
StreamTables(position string, tables []string, charset *mproto.Charset, sendReply func(reply *BinlogTransaction) error) error
// HandlePanic should be called in a defer,
// first thing in the RPC implementation.
HandlePanic(*error)
}