server

package
v2.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package server is DEPRECATED, left for backwards compatibility.

Please use github.com/EridanSilver/clay/v2/server directly instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option = server.Option

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

func WithHTTPMux(mux *chi.Mux) Option

WithHTTPMux sets existing HTTP muxer to use instead of creating new one.

func WithHTTPPort

func WithHTTPPort(port int) Option

WithHTTPPort sets HTTP RPC port to listen on. Set same port as main to use single port.

func WithHTTPRouterMux

func WithHTTPRouterMux(mux transport.Router) Option

type Server

type Server = server.Server

Server is a transport server.

func NewServer

func NewServer(rpcPort int, opts ...Option) *Server

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL