httpd

package module
v0.0.0-...-6b8354a Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: AGPL-3.0 Imports: 9 Imported by: 1

README

go-httpd

Simple http server to replace go's default http in your projects.

TODO:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Port

func Port(port int) func(*Httpd) error

Types

type Httpd

type Httpd struct {
	Address string
	// contains filtered or unexported fields
}

Httpd main struct

func New

func New(options ...func(*Httpd) error) (*Httpd, error)

New creates a new Httpd instance

func (*Httpd) Handle

func (h *Httpd) Handle(route string, handler http.Handler)

func (*Httpd) HandleFunc

func (h *Httpd) HandleFunc(
	newroute string,
	handler func(http.ResponseWriter, *http.Request),
)

HandleFunc adds a route to the map of handlers

func (*Httpd) HandleSignal

func (h *Httpd) HandleSignal(q chan os.Signal)

func (*Httpd) ListenAndServe

func (h *Httpd) ListenAndServe(address ...string) error

ListenAndServe starts Httpd listening on the defined address

func (*Httpd) ServeHTTP

func (h *Httpd) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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