server

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Simple wrapper around http.Server with graceful shutdown and easy tls setup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(addr string, options ...option) *server

Create a new http server instance. Run the server by calling the Run method on it.

func WithAddr

func WithAddr(addr string) option

Set server address to addr

func WithHandler

func WithHandler(h http.Handler) option

set server handler to h

func WithReadTimeout

func WithReadTimeout(timeout time.Duration) option

set server ReadTimeout to timeout

func WithTLS

func WithTLS(certFile, keyFile string) option

Start the server with tls enabled by certificates

func WithWriteTimeout

func WithWriteTimeout(timeout time.Duration) option

set server WriteTimeout to timeout

Types

This section is empty.

Jump to

Keyboard shortcuts

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