runner

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSignalGroup

func NewSignalGroup(backgroundContext context.Context) (context.Context, *errgroup.Group)

NewSignalGroup creates a new context and error group that handles OS interrupt signals.

func RunFiber

func RunFiber(ctx context.Context, group *errgroup.Group, fiberApp FiberApp, addr string)

RunFiber starts a Fiber application in a new goroutine and shuts it down when the context is cancelled.

func RunGRPC

func RunGRPC(ctx context.Context, group *errgroup.Group, grpcServer GRPCServer, addr string)

RunGRPC starts a gRPC server in a new goroutine and shuts it down when the context is cancelled.

func RunHandler

func RunHandler(ctx context.Context, group *errgroup.Group, handler http.Handler, addr string)

RunHandler starts a HTTP server in a new goroutine and shuts it down when the context is cancelled.

Types

type FiberApp

type FiberApp interface {
	Listen(addr string) error
	Shutdown() error
}

FiberApp is an interface that represents a Fiber application.

type GRPCServer

type GRPCServer interface {
	Serve(lis net.Listener) error
	GracefulStop()
}

GRPCServer is an interface that represents a gRPC server.

Jump to

Keyboard shortcuts

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