server

package
v0.0.0-...-a1efa92 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeveledLogger

type LeveledLogger interface {
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Debugw(msg string, keysAndValues ...interface{})

	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Infow(msg string, keysAndValues ...interface{})

	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
}

LeveledLogger has log levels Debug, Info, Error

type Server

type Server interface {
	Serve(ctx context.Context) error
}

Server provides a function to run an http.HTTPServer with graceful shutdown

func New

func New(h http.Handler, port int, shutdownTimeout time.Duration, log LeveledLogger) Server

New does exactly what its name implies

Jump to

Keyboard shortcuts

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