http

package
v0.0.0-...-24a8c69 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(next http.Handler) http.Handler

ContentType is a middleware setting the content type.

func IsBrokenPipe

func IsBrokenPipe(e error) bool

IsBrokenPipe checks if the error is a broken pipe error.

func ListenAndServe

func ListenAndServe(handler http.Handler, config Config) chan error

ListenAndServe listens and serves on the configured port. If a certificate and key file are configured, a TLS-based server is created.

func NewRouter

func NewRouter() *chi.Mux

NewRouter returns chi router.

Types

type Config

type Config struct {
	Host     string
	Port     string
	CertFile string // Key certificate file.
	KeyFile  string // Private key file.
}

Config represents server configuration.

func (Config) Validate

func (cfg Config) Validate() error

Validate validates the server configuration.

Jump to

Keyboard shortcuts

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