graceful

package
v0.46.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeGRPC

func ServeGRPC(ctx context.Context, server *grpc.Server, port int) error

ServeGRPC serves a GRPC server and performs a graceful shutdown if/when ctx is cancelled.

func ServeHTTP

func ServeHTTP(ctx context.Context, server *http.Server, options ServeOptions) error

ServeHTTP serves a HTTP server and performs a graceful shutdown if/when ctx is cancelled.

func WithCancelOnTerminate

func WithCancelOnTerminate(ctx context.Context) context.Context

WithCancelOnTerminate derives a context that is cancelled on SIGINT and SIGTERM signals.

Types

type ServeOptions added in v0.42.0

type ServeOptions struct {
	Port     int
	CertPath string
	KeyPath  string
}

Jump to

Keyboard shortcuts

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