Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCServer ¶ added in v0.6.0
type GRPCServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(config server.Config, opts ...Option) (*GRPCServer, error)
New creates a gRPC server which has no service registered and has not started to accept requests yet.
func (*GRPCServer) Register ¶ added in v0.6.0
func (s *GRPCServer) Register(services []Service)
Register registers the given slices of services with the server. This must be called before invoking Server.
func (*GRPCServer) Serve ¶ added in v0.6.0
func (s *GRPCServer) Serve(result chan<- error)
Serve accepts incoming incoming connections, reads the gRPC requests and calls the registered service handlers to reply to them. This will return a non-nil error unless Stop is called.
func (*GRPCServer) Stop ¶ added in v0.6.0
func (s *GRPCServer) Stop()
Stop shuts down the gRPC server gracefully. It stops the server from accepting new connections and blocks until all the pending RPCs have completed.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option provides options for configuring the creation of a gRPC server.
func WithInsecure ¶
func WithInsecure() Option
WithInsecure will configure the server to allow insecure connections.
func WithLogger ¶
WithLogger will configure a unary server interceptor which provides logging of each gRPC request, and embeds a logger into the request's context.
func WithMetrics ¶
func WithMetrics() Option
WithMetrics will configure a unary server interceptor which provides server side metrics.
func WithTracer ¶
WithTrace will configure a unary server interceptor which provides tracing of each gRPC request, and embeds trace info into the request's context.
func WithoutReflection ¶
func WithoutReflection() Option
WithoutReflection disables the registration of the reflection service.