Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCreateListener is returned when the listener creation fails. ErrCreateListener = errors.New("failed to create listener") // ErrServerNotStarted is returned when the server is not started yet. ErrServerNotStarted = errors.New("server not started") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*server)
Option is a function that configures the gRPC server.
func WithDefaultInterceptors ¶
func WithDefaultInterceptors() Option
WithDefaultInterceptors adds the default interceptors to the gRPC server.
func WithStreamInterceptor ¶
func WithStreamInterceptor(i grpc.StreamServerInterceptor) Option
WithStreamInterceptor adds a stream interceptor to the gRPC server.
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(i grpc.UnaryServerInterceptor) Option
WithUnaryInterceptor adds a unary interceptor to the gRPC server.
type Server ¶
type Server interface { // RegisterService registers a service to the gRPC server. RegisterService(registration ServiceRegistration) // Start starts the gRPC server. Start(context.Context) error // Stop stops the gRPC server. Stop(context.Context) error }
Server is a gRPC server.
type ServiceRegistration ¶
type ServiceRegistration func(grpc.ServiceRegistrar)
ServiceRegistration is a function that registers a service to the gRPC server.
Directories ¶
Path | Synopsis |
---|---|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.