httpserv

package
v0.0.0-...-8a90fd1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package httpserv contains HTTP server utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocationWithTrailingSlash

func LocationWithTrailingSlash(u *url.URL) string

LocationWithTrailingSlash returns the URL in a relative format, with a trailing slash.

Types

type WrappedServer

type WrappedServer struct {
	// contains filtered or unexported fields
}

WrappedServer is a wrapper around http.Server that provides: - net.Listener allocation and closure - TLS allocation - exit on panic - logging - server header - filtering of invalid requests

func NewWrappedServer

func NewWrappedServer(
	network string,
	address string,
	readTimeout time.Duration,
	serverCert string,
	serverKey string,
	handler http.Handler,
	parent logger.Writer,
) (*WrappedServer, error)

NewWrappedServer allocates a WrappedServer.

func (*WrappedServer) Close

func (s *WrappedServer) Close()

Close closes all resources and waits for all routines to return.

Jump to

Keyboard shortcuts

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