Documentation ¶
Index ¶
- func NewGatewayServer(c *config.Config) api.Interface
- func NewGrpcServer(c *config.Config) api.Interface
- func NewMuxServer(mux cmux.CMux, lis net.Listener) api.Interface
- type Engine
- type GatewayServer
- type GrpcServer
- type MuxServer
- type Option
- func WithAddr(network, addr string) Option
- func WithDefaultLogger() Option
- func WithGatewayAddr(network, addr string) Option
- func WithGatewayDialOptions(opts ...grpc.DialOption) Option
- func WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) Option
- func WithGatewayServerConfig(cfg *config.HTTPServerConfig) Option
- func WithGatewayServerMiddlewares(middlewares ...middleware.HTTPServerMiddleware) Option
- func WithGatewayServerStreamInterceptors(interceptors ...grpc.StreamClientInterceptor) Option
- func WithGatewayServerUnaryInterceptors(interceptors ...grpc.UnaryClientInterceptor) Option
- func WithGrpcAddr(network, addr string) Option
- func WithGrpcInternalAddr(network, addr string) Option
- func WithGrpcServerOptions(opts ...grpc.ServerOption) Option
- func WithGrpcServerStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) Option
- func WithGrpcServerUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) Option
- func WithPassedHeader(decider middleware.PassedHeaderDeciderFunc) Option
- func WithServers(svrs ...api.Server) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGatewayServer ¶
NewGatewayServer creates GrpcServer instance.
func NewGrpcServer ¶
NewGrpcServer creates GrpcServer instance.
Types ¶
type GatewayServer ¶
GatewayServer wraps gRPC gateway server setup process.
func (*GatewayServer) Serve ¶
func (s *GatewayServer) Serve(l net.Listener) error
Serve implements Server.Shutdown
func (*GatewayServer) Shutdown ¶
func (s *GatewayServer) Shutdown()
Shutdown implements Server.Shutdown
type GrpcServer ¶
GrpcServer wraps grpc.Server setup process.
type MuxServer ¶
type MuxServer struct {
// contains filtered or unexported fields
}
MuxServer wraps a connection multiplexer and a listener.
type Option ¶
Option configures a gRPC and a gateway server.
func WithAddr ¶
WithAddr returns an Option that sets an network address for a gRPC and a gateway server.
func WithDefaultLogger ¶
func WithDefaultLogger() Option
WithDefaultLogger returns an Option that sets default grpclogger.LoggerV2 object.
func WithGatewayAddr ¶
WithGatewayAddr returns an Option that sets an network address for a gateway server.
func WithGatewayDialOptions ¶
func WithGatewayDialOptions(opts ...grpc.DialOption) Option
WithGatewayDialOptions returns an Option that sets grpc.DialOption(s) to a gRPC clinet used by a gateway server.
func WithGatewayMuxOptions ¶
func WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) Option
WithGatewayMuxOptions returns an Option that sets runtime.ServeMuxOption(s) to a gateway server.
func WithGatewayServerConfig ¶
func WithGatewayServerConfig(cfg *config.HTTPServerConfig) Option
WithGatewayServerConfig returns an Option that specifies http.api.Server configuration to a gateway server.
func WithGatewayServerMiddlewares ¶
func WithGatewayServerMiddlewares(middlewares ...middleware.HTTPServerMiddleware) Option
WithGatewayServerMiddlewares returns an Option that sets middleware(s) for http.api.Server to a gateway server.
func WithGatewayServerStreamInterceptors ¶
func WithGatewayServerStreamInterceptors(interceptors ...grpc.StreamClientInterceptor) Option
WithGatewayServerStreamInterceptors returns an Option that sets stream interceptor(s) for a gRPC client used by a gateway server.
func WithGatewayServerUnaryInterceptors ¶
func WithGatewayServerUnaryInterceptors(interceptors ...grpc.UnaryClientInterceptor) Option
WithGatewayServerUnaryInterceptors returns an Option that sets unary interceptor(s) for a gRPC client used by a gateway server.
func WithGrpcAddr ¶
WithGrpcAddr returns an Option that sets an network address for a gRPC server.
func WithGrpcInternalAddr ¶
WithGrpcInternalAddr returns an Option that sets an network address connected by a gateway server.
func WithGrpcServerOptions ¶
func WithGrpcServerOptions(opts ...grpc.ServerOption) Option
WithGrpcServerOptions returns an Option that sets grpc.ServerOption(s) to a gRPC server.
func WithGrpcServerStreamInterceptors ¶
func WithGrpcServerStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) Option
WithGrpcServerStreamInterceptors returns an Option that sets stream interceptor(s) for a gRPC server.
func WithGrpcServerUnaryInterceptors ¶
func WithGrpcServerUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) Option
WithGrpcServerUnaryInterceptors returns an Option that sets unary interceptor(s) for a gRPC server.
func WithPassedHeader ¶
func WithPassedHeader(decider middleware.PassedHeaderDeciderFunc) Option
WithPassedHeader returns an Option that sets configurations about passed headers for a gateway server.
func WithServers ¶
WithServers returns an Option that sets gRPC service server implementation(s).