Documentation ¶
Overview ¶
Package grpcsync implements (in ALPHA VERSION) the gRPC client and server that satisfies the datasync API (see the definition of the service in ../syncbase/msg package). This implementation is special (comparing to dbsync or msgsync) because it does not use any intermediate persistence between the client and the server. Therefore the client does remote calls to each individual server/agent instance (and needs to know its IP address & port).
Index ¶
- Variables
- type Adapter
- type DataMsgServiceServer
- func (s *DataMsgServiceServer) DataChanges(stream msg.DataMsgService_DataChangesServer) error
- func (s *DataMsgServiceServer) DataResyncs(ctx context.Context, req *msg.DataResyncRequests) (*msg.DataResyncReplies, error)
- func (s *DataMsgServiceServer) Ping(ctx context.Context, req *msg.PingRequest) (*msg.PingReply, error)
- type Deps
- type Option
- type Plugin
Constants ¶
This section is empty.
Variables ¶
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of Plugin.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is a gRPC transport adapter in front of Agent Plugins.
func NewAdapter ¶
NewAdapter creates a new instance of Adapter.
func (*Adapter) Watch ¶
func (adapter *Adapter) Watch(resyncName string, changeChan chan datasync.ChangeEvent, resyncChan chan datasync.ResyncEvent, keyPrefixes ...string) (datasync.WatchRegistration, error)
Watch registers HTTP handlers - basically bridges them with local dbadapter.
type DataMsgServiceServer ¶
type DataMsgServiceServer struct {
// contains filtered or unexported fields
}
DataMsgServiceServer is //TODO
func NewDataMsgServiceServer ¶
func NewDataMsgServiceServer(adapter *Adapter) *DataMsgServiceServer
NewDataMsgServiceServer creates a new instance of DataMsgServiceServer.
func (*DataMsgServiceServer) DataChanges ¶
func (s *DataMsgServiceServer) DataChanges(stream msg.DataMsgService_DataChangesServer) error
DataChanges propagates the events in the stream to go channels of registered plugins.
func (*DataMsgServiceServer) DataResyncs ¶
func (s *DataMsgServiceServer) DataResyncs(ctx context.Context, req *msg.DataResyncRequests) ( *msg.DataResyncReplies, error)
DataResyncs propagates the events in the stream to go channels of registered plugins.
func (*DataMsgServiceServer) Ping ¶
func (s *DataMsgServiceServer) Ping(ctx context.Context, req *msg.PingRequest) (*msg.PingReply, error)
Ping checks the connectivity/ measures the minimal transport latency.
type Deps ¶ added in v1.0.4
type Deps struct { infra.PluginName GRPC grpc.Server }
Deps represent Plugin dependencies.
type Option ¶ added in v1.5.0
type Option func(*Plugin)
Option is a function that can be used in NewPlugin to customize Plugin.