grpc

package
v0.0.0-...-94a6a7c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxSendMsgSize is the default max send message size, per gRPC
	DefaultMaxSendMsgSize = 1024 * 1024 * 4

	// DefaultMaxRecvMsgSize is the default max receive message size, per gRPC
	DefaultMaxRecvMsgSize = 1024 * 1024 * 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is used to construct a gRPC server.

func New

func New() *Builder

New will create a new gRPC server builder.

func (*Builder) Build

func (b *Builder) Build() *grpc.Server

Build a gRPC server.

func (*Builder) Register

func (b *Builder) Register(registerFunc interface{}, srv interface{}) *Builder

Register adds a gRPC registration function and an associated server implementation. The registerFunc should be something akin to RegisterSampleServer(s *grpc.Server, srv SampleServer) and srv should be an implementation that satisfies the srv interface in registerFunc.

func (*Builder) WithMaxRecvMsgSize

func (b *Builder) WithMaxRecvMsgSize(size int) *Builder

WithMaxRecvMsgSize will change the size of messages that can be received by the service.

func (*Builder) WithMaxSendMsgSize

func (b *Builder) WithMaxSendMsgSize(size int) *Builder

WithMaxSendMsgSize will change the size of messages that can be sent from the service.

func (*Builder) WithOptions

func (b *Builder) WithOptions(options ...grpc.ServerOption) *Builder

WithOptions adds additional server options for customizing the server further.

func (*Builder) WithStreamInterceptors

func (b *Builder) WithStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) *Builder

WithStreamInterceptors adds stream interceptors to be used by the service. They will be executed in order, from first to last.

func (*Builder) WithTLS

func (b *Builder) WithTLS(config *tls.Config) *Builder

WithTLS adds configuration to provide secure communications via TLS (Transport Layer Security).

func (*Builder) WithUnaryInterceptors

func (b *Builder) WithUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) *Builder

WithUnaryInterceptors adds unary interceptors to be used by the service. They will be executed in order, from first to last.

Jump to

Keyboard shortcuts

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