Documentation ¶
Index ¶
- Variables
- func DisableHealth() utility.Option[Server]
- func WithAddr(network, addr string) utility.Option[Server]
- func WithListener(lis net.Listener) utility.Option[Server]
- func WithLogger(logger *slog.Logger) utility.Option[Server]
- func WithMiddleware(middlewares ...middleware.Middleware) utility.Option[Server]
- func WithServerOption(opts ...grpc.ServerOption) utility.Option[Server]
- func WithStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) utility.Option[Server]
- func WithTLS(config *tls.Config) utility.Option[Server]
- func WithUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) utility.Option[Server]
- type Context
- type Server
- type Transport
- type Transporter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NoListener = errors.New("[gRPC] server not bind listener")
)
Functions ¶
func DisableHealth ¶
func WithAddr ¶
WithAddr create a listener with network and address WithAddr and WithListener just choose one of them
func WithListener ¶
WithListener uses the given listener WithListener and WithAddr just choose one of them
func WithMiddleware ¶
func WithMiddleware(middlewares ...middleware.Middleware) utility.Option[Server]
func WithServerOption ¶
func WithServerOption(opts ...grpc.ServerOption) utility.Option[Server]
WithServerOption inject grpc.ServerOption to server
func WithStreamInterceptor ¶
func WithStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) utility.Option[Server]
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) utility.Option[Server]
Types ¶
type Context ¶
func NewServerContext ¶
type Server ¶
type Server struct { *types.BaseServer // contains filtered or unexported fields }
func (*Server) RegisterService ¶
RegisterService register server to grpc server
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) RequestHeader ¶
func (*Transport) ResponseHeader ¶
type Transporter ¶
Click to show internal directories.
Click to hide internal directories.