servers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package servers provides common servers starting code for all SaaS components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunDebugServer

func RunDebugServer(ctx context.Context, opts *RunDebugServerOpts)

RunDebugServer runs debug server with given options until ctx is canceled. All errors cause panic.

func RunHTTPServer

func RunHTTPServer(ctx context.Context, opts *RunHTTPServerOpts)

RunHTTPServer runs HTTP server with given options until ctx is canceled. All errors cause panic.

Types

type GRPCServer

type GRPCServer interface {
	// Run runs the server until ctx is canceled.
	Run(ctx context.Context)

	// GetUnderlyingServer returns underlying grpc.Server, use it for your server
	// implementation registration. Don't use any control method of returned grpc.Server;
	// use GRPCServer.Run method only.
	GetUnderlyingServer() *grpc.Server
}

GRPCServer is an interface wrapper for gRPC Server.

func NewGRPCServer

func NewGRPCServer(ctx context.Context, opts *NewGRPCServerOpts) GRPCServer

NewGRPCServer creates new gRPC server with given options.

type NewGRPCServerOpts

type NewGRPCServerOpts struct {
	Addr            string
	WarnDuration    time.Duration
	ShutdownTimeout time.Duration
}

NewGRPCServerOpts configure gRPC server.

type RunDebugServerOpts

type RunDebugServerOpts struct {
	Addr            string
	ShutdownTimeout time.Duration
	Healthz         func() error
	Readyz          func() error
}

RunDebugServerOpts configure debug server.

type RunHTTPServerOpts

type RunHTTPServerOpts struct {
	Addr            string
	Handler         http.Handler
	ShutdownTimeout time.Duration
}

RunHTTPServerOpts configure HTTP server.

Jump to

Keyboard shortcuts

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