Documentation
¶
Index ¶
- type Option
- func CombineOptions(options ...Option) Option
- func NoopOption() Option
- func WithGRPCServerOption(opt grpc.ServerOption) Option
- func WithGracePeriod(t time.Duration) Option
- func WithListen(s string) Option
- func WithNetwork(s string) Option
- func WithOtelTracing() Option
- func WithServer(f registerServerFunc) Option
- func WithStreamServerInterceptor(interceptor grpc.StreamServerInterceptor) Option
- func WithTLSConfig(cfg *tls.Config) Option
- func WithUnaryServerInterceptor(interceptor grpc.UnaryServerInterceptor) Option
- type Options
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option = func(o *Options)
Option is option function.
func CombineOptions ¶
CombineOptions combine multi Option into one.
func WithGRPCServerOption ¶
func WithGRPCServerOption(opt grpc.ServerOption) Option
WithGRPCServerOption allows adding raw grpc.ServerOption's to the instantiated gRPC server.
func WithGracePeriod ¶
WithGracePeriod sets shutdown grace period for gRPC server. Server waits connections to drain for specified amount of time.
func WithListen ¶
WithListen sets address to listen for gRPC server. Server accepts incoming connections on given address.
func WithNetwork ¶
WithNetwork sets network to listen for gRPC server e.g tcp, udp or unix.
func WithOtelTracing ¶
func WithOtelTracing() Option
WithOtelTracing append opentelemetry interceptors.
func WithServer ¶
func WithServer(f registerServerFunc) Option
WithServer calls the passed gRPC registration functions on the created grpc.Server.
func WithStreamServerInterceptor ¶
func WithStreamServerInterceptor(interceptor grpc.StreamServerInterceptor) Option
WithStreamServerInterceptor append a grpc StreamServerInterceptor.
func WithTLSConfig ¶
WithTLSConfig sets TLS configuration for gRPC server.
func WithUnaryServerInterceptor ¶
func WithUnaryServerInterceptor(interceptor grpc.UnaryServerInterceptor) Option
WithUnaryServerInterceptor append a grpc UnaryServerInterceptor.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is extgrpc server options.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is our extgrpc server.
func (*Server) ListenAndServe ¶
ListenAndServe listen and serve grpc server.