grpcsync

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

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

func NewAdapter(grpcServer *grpc.Server) *Adapter

NewAdapter creates a new instance of Adapter.

func (*Adapter) Close

func (adapter *Adapter) Close() error

Close closes the gRPC server.

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

DataChanges propagates the events in the stream to go channels of registered plugins.

func (*DataMsgServiceServer) DataResyncs

DataResyncs propagates the events in the stream to go channels of registered plugins.

func (*DataMsgServiceServer) Ping

Ping checks the connectivity/ measures the minimal transport latency.

type Deps added in v1.0.4

type Deps struct {
	GRPC grpc.Server
}

Deps - gRPC Plugin dependencies

type Plugin

type Plugin struct {
	Deps
	Adapter datasync.KeyValProtoWatcher
}

Plugin grpcsync implements Plugin interface, therefore can be loaded with other plugins.

func (*Plugin) Close

func (plugin *Plugin) Close() error

Close does nothing.

func (*Plugin) Init

func (plugin *Plugin) Init() error

Init registers new gRPC service and instantiates plugin.Adapter.

Jump to

Keyboard shortcuts

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