server

package
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCGatewayGeneratedHandlers

type GRPCGatewayGeneratedHandlers func(mux *runtime.ServeMux, endpoint string) error

GRPCGatewayGeneratedHandlers alias for gRPC-gateway endpoint registrations

type GRPCGatewayInterceptor

type GRPCGatewayInterceptor func(handler http.Handler) http.Handler

GRPCGatewayInterceptor alias for gRPC-gateway interceptor

type GRPCServerAPI

type GRPCServerAPI func(server *grpc.Server)

GRPCServerAPI alias for gRPC API function registration

type GRPCWebServiceBuilder

type GRPCWebServiceBuilder interface {
	ListenOn(addr string) GRPCWebServiceBuilder
	SetCustomGRPCServer(customServer *grpc.Server) GRPCWebServiceBuilder
	SetCustomListener(listener net.Listener) GRPCWebServiceBuilder
	RegisterGRPCAPIs(register ...GRPCServerAPI) GRPCWebServiceBuilder
	AddGRPCServerOptions(options ...grpc.ServerOption) GRPCWebServiceBuilder
	SetPanicHandler(handler func(interface{}) error) GRPCWebServiceBuilder
	SetLogger(logger func(ctx context.Context, format string, args ...interface{})) GRPCWebServiceBuilder
	AddRESTServerConfiguration() RESTBuilder
	Build() (WebService, error)
}

GRPCWebServiceBuilder defines gRPC web service builder options

type ListenInfo

type ListenInfo struct {
	Address string        `json:"address"`
	Port    int           `json:"port"`
	Type    WebServerType `json:"type"`
}

ListenInfo defines port info

type RESTBuilder

type RESTBuilder interface {
	ListenOn(addr string) RESTBuilder
	SetCustomServer(customServer *http.Server) RESTBuilder
	SetCustomListener(listener net.Listener) RESTBuilder
	AddHandler(pattern string, handler http.Handler) RESTBuilder
	AddHandlerFunc(pattern string, handlerFunc http.HandlerFunc) RESTBuilder
	SetCustomGRPCGatewayMux(mux *runtime.ServeMux) RESTBuilder
	RegisterGRPCGatewayHandlers(handlers ...GRPCGatewayGeneratedHandlers) RESTBuilder
	AddGRPCGatewayOptions(options ...runtime.ServeMuxOption) RESTBuilder
	AddGRPCGatewayInterceptors(interceptors ...GRPCGatewayInterceptor) RESTBuilder
	BuildRESTPart() GRPCWebServiceBuilder
}

RESTBuilder defines REST web service builder options

type WebServerType

type WebServerType string

WebServerType string enum

const (
	// GRPCServer type
	GRPCServer WebServerType = "GRPC"
	// RESTServer type
	RESTServer WebServerType = "REST"
)

type WebService

type WebService interface {
	Run(ctx context.Context) error
	Stop(ctx context.Context) error
	Ports() []ListenInfo
}

WebService defines our web service functions

Directories

Path Synopsis
Package mock_server is a generated GoMock package.
Package mock_server is a generated GoMock package.

Jump to

Keyboard shortcuts

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