rpc

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port     int
	CertFile string
	KeyFile  string
}

Config is the configuration for creating a Server instance.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a normal server that processes the logic requested by the client.

func NewServer

func NewServer(conf *Config, be *backend.Backend) (*Server, error)

NewServer creates a new instance of Server.

func (*Server) ActivateClient

func (s *Server) ActivateClient(
	ctx context.Context,
	req *api.ActivateClientRequest,
) (*api.ActivateClientResponse, error)

ActivateClient activates the given client.

func (*Server) AttachDocument

func (s *Server) AttachDocument(
	ctx context.Context,
	req *api.AttachDocumentRequest,
) (*api.AttachDocumentResponse, error)

AttachDocument attaches the given document to the client.

func (*Server) DeactivateClient

func (s *Server) DeactivateClient(
	ctx context.Context,
	req *api.DeactivateClientRequest,
) (*api.DeactivateClientResponse, error)

DeactivateClient deactivates the given client.

func (*Server) DetachDocument

func (s *Server) DetachDocument(
	ctx context.Context,
	req *api.DetachDocumentRequest,
) (*api.DetachDocumentResponse, error)

DetachDocument detaches the given document to the client.

func (*Server) PushPull

func (s *Server) PushPull(
	ctx context.Context,
	req *api.PushPullRequest,
) (*api.PushPullResponse, error)

PushPull stores the changes sent by the client and delivers the changes accumulated in the agent to the client.

func (*Server) Shutdown

func (s *Server) Shutdown(graceful bool)

Shutdown shuts down this server.

func (*Server) Start

func (s *Server) Start() error

Start starts this server by opening the rpc port.

func (*Server) WatchDocuments

func (s *Server) WatchDocuments(
	req *api.WatchDocumentsRequest,
	stream api.Yorkie_WatchDocumentsServer,
) error

WatchDocuments connects the stream to deliver events from the given documents to the requesting client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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