server

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsHttpAndGrpcHandlerFunc

func CorsHttpAndGrpcHandlerFunc(
	httpHandler http.Handler,
	grpcHandler http.Handler,
	options *HttpAndGrpcHandlerOptions,
) http.Handler

func DefaultHttpAndGrpcHandlerFunc

func DefaultHttpAndGrpcHandlerFunc(
	httpHandler http.Handler,
	grpcHandler http.Handler,
	options *HttpAndGrpcHandlerOptions,
) http.Handler

Types

type HttpAndGrpcHandlerFunc

type HttpAndGrpcHandlerFunc func(
	httpHandler http.Handler,
	grpcHandler http.Handler,
	options *HttpAndGrpcHandlerOptions,
) http.Handler

type HttpAndGrpcHandlerOptions added in v0.2.0

type HttpAndGrpcHandlerOptions struct {
	GetOrigin                func(r *http.Request) string
	AdditionalAllowedHeaders []string
}

type Server

type Server struct {
	Port       int
	GrpcMux    *runtime.ServeMux
	GrpcServer *grpc.Server
	HttpServer *http.Server
}

func NewServer

func NewServer(config *ServerConfig) *Server

func (*Server) Serve

func (s *Server) Serve()

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type ServerConfig

type ServerConfig struct {
	Port                   int
	HttpAndGrpcHandlerFunc HttpAndGrpcHandlerFunc
	HandlerOptions         *HttpAndGrpcHandlerOptions
}

Jump to

Keyboard shortcuts

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