httpproc

package
v0.0.0-...-87eb39d Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(srv *http.Server) proc.Impl

ListenAndServe is like Serve but it first creates a listen socket for srv.Addr and serves on that. Along with the error conditions for Serve, ListenAndServe may also return an error if listening fails.

func ListenAndServeTLS

func ListenAndServeTLS(srv *http.Server, certFile, keyFile string) proc.Impl

ListenAndServeTLS is like ServeTLS but it first creates a listen socket for srv.Addr and serves on that. Along with the error conditions for Serve, ListenAndServe may also return an error if listening fails. certFile and keyFile have the same meaning as for http.ListenAndServeTLS.

func Serve

func Serve(srv *http.Server, l net.Listener) proc.Impl

Serve returns a process implementation that serves the given HTTP server on the given listener until the process context is cancelled or hits its deadline.

Once the context is done, it will instruct the server to shut down and return only after shutdown has completed.

The Handler field in srv is replaced with a wrapper that attaches the process context to the request.

The process will fail (return an error) if listening fails or if shutdown fails. A successful shutdown is not an error.

func ServeTLS

func ServeTLS(srv *http.Server, l net.Listener, certFile, keyFile string) proc.Impl

ServeTLS is like Serve but runs a TLS server instead. The TLSConfig field of srv and the certFile and keyFile arguments are used in the same way as for http.ServeTLS.

Types

This section is empty.

Jump to

Keyboard shortcuts

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