Documentation ¶
Index ¶
- type Option
- func WithGRPCOpts(opts []grpc.ServerOption) Option
- func WithGRPCStreamMiddlewares(mws ...grpc.StreamServerInterceptor) Option
- func WithGRPCUnaryMiddlewares(mws ...grpc.UnaryServerInterceptor) Option
- func WithHTTPMiddlewares(mws ...mwhttp.Middleware) Option
- func WithHTTPMux(mux *chi.Mux) Option
- func WithHTTPPort(port int) Option
- func WithHTTPRouterMux(mux transport.Router) Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*serverOpts)
Option is an optional setting applied to the Server.
func WithGRPCOpts ¶
func WithGRPCOpts(opts []grpc.ServerOption) Option
WithGRPCOpts sets gRPC server options.
func WithGRPCStreamMiddlewares ¶
func WithGRPCStreamMiddlewares(mws ...grpc.StreamServerInterceptor) Option
WithGRPCStreamMiddlewares sets up stream middlewares for gRPC server.
func WithGRPCUnaryMiddlewares ¶
func WithGRPCUnaryMiddlewares(mws ...grpc.UnaryServerInterceptor) Option
WithGRPCUnaryMiddlewares sets up unary middlewares for gRPC server.
func WithHTTPMiddlewares ¶
func WithHTTPMiddlewares(mws ...mwhttp.Middleware) Option
WithHTTPMiddlewares sets up HTTP middlewares to work with.
func WithHTTPMux ¶
WithHTTPMux sets existing HTTP muxer to use instead of creating new one.
func WithHTTPPort ¶
WithHTTPPort sets HTTP RPC port to listen on. Set same port as main to use single port.
func WithHTTPRouterMux ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a transport server.
func NewServer ¶
NewServer creates a Server listening on the rpcPort. Pass additional Options to mutate its behaviour. By default, HTTP JSON handler and gRPC are listening on the same port, admin port is p+2 and profile port is p+4.