httputil

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitListener

func LimitListener(addr string, opts ...ListenerOption) (net.Listener, error)

LimitListener creates a tcp keep-alive listener with 400 maximum connections.

func Server

func Server(addr string, handler http.Handler, opts ...ServerOption) http.Server

Server creates a HTTP server with time out settings.

Types

type ListenerOption

type ListenerOption func(*listenerConfig)

ListenerOption is a listener option

func SetConnectionCount

func SetConnectionCount(c int) ListenerOption

SetConnectionCount sets connection count

type ServerOption

type ServerOption func(*serverConfig)

ServerOption is a server option

func SetTimeout

func SetTimeout(r, w, i time.Duration) ServerOption

SetTimeout sets timeout

Jump to

Keyboard shortcuts

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