protoprocess

package
v0.0.0-...-c5da4db Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultChunkSizeBytes is the default chunk size used for sending and receiving.
	DefaultChunkSizeBytes = 65536
)

Functions

func RegisterAPIServer

func RegisterAPIServer(s *grpc.Server, srv APIServer)

Types

type APIClient

type APIClient interface {
	Do(ctx context.Context, opts ...grpc.CallOption) (API_DoClient, error)
}

func NewAPIClient

func NewAPIClient(cc *grpc.ClientConn) APIClient

type APIServer

type APIServer interface {
	Do(API_DoServer) error
}

func NewAPIServer

func NewAPIServer(processor Processor, server Server) APIServer

NewAPIServer returns a new APIServer for the given Server.

type API_DoClient

type API_DoClient interface {
	Send(*google_protobuf.BytesValue) error
	Recv() (*google_protobuf.BytesValue, error)
	grpc.ClientStream
}

type API_DoServer

type API_DoServer interface {
	Send(*google_protobuf.BytesValue) error
	Recv() (*google_protobuf.BytesValue, error)
	grpc.ServerStream
}

type Client

type Client interface {
	Process(dirPath string, streamingBytesDuplexCloser protostream.StreamingBytesDuplexCloser) error
}

Client calls a remote Processor.

func NewClient

func NewClient(archiver pkgarchive.Archiver, opts ClientOptions) Client

NewClient returns a new Client.

type ClientOptions

type ClientOptions struct {
	ChunkSizeBytes int
}

ClientOptions are options to the construction of a Client.

type Processor

type Processor interface {
	Process(dirPath string) error
}

Processor processes the contents of a directory.

The result of a call to a Processor is that the directory may have modified contents.

func NewAPIProcessor

func NewAPIProcessor(client Client, apiClient APIClient) Processor

NewAPIProcessor returns a new Processor that calls an APIClient.

type Server

type Server interface {
	Handle(processor Processor, streamingBytesDuplexer protostream.StreamingBytesDuplexer) error
}

Server wraps a Processor.

func NewServer

func NewServer(archiver pkgarchive.Archiver, opts ServerOptions) Server

NewServer returns a new Server.

type ServerOptions

type ServerOptions struct {
	ChunkSizeBytes int
}

ServerOptions are options to the construction of a Server.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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