Documentation ¶
Index ¶
- Constants
- type Builder
- func (b *Builder) Build() *grpc.Server
- func (b *Builder) Register(registerFunc interface{}, srv interface{}) *Builder
- func (b *Builder) WithMaxRecvMsgSize(size int) *Builder
- func (b *Builder) WithMaxSendMsgSize(size int) *Builder
- func (b *Builder) WithOptions(options ...grpc.ServerOption) *Builder
- func (b *Builder) WithStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) *Builder
- func (b *Builder) WithTLS(config *tls.Config) *Builder
- func (b *Builder) WithUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) *Builder
Constants ¶
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 (*Builder) Register ¶
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 ¶
WithMaxRecvMsgSize will change the size of messages that can be received by the service.
func (*Builder) WithMaxSendMsgSize ¶
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 ¶
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.