httpu

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServer

func FileServer(root string) func(*http.Server)

func GetFreePort

func GetFreePort() (int, error)

func HTTPS added in v0.1.1

func HTTPS(interupt context.Context, domain, email string, opts ...func(*http.Server)) error

func HandleFunc

func HandleFunc(path string, f func(w http.ResponseWriter, r *http.Request)) func(*http.Server)

func HandleStats

func HandleStats(path string, stats func() interface{}) func(*http.Server)

func Handler

func Handler(h http.Handler) func(*http.Server)

func HandlerFunc

func HandlerFunc(handlerFunc func(w http.ResponseWriter, r *http.Request)) func(*http.Server)

func HealthCheck

func HealthCheck(handler func(w http.ResponseWriter, r *http.Request)) func(*http.Server)

func Metrics

func Metrics() func(*http.Server)

func Mux

func Mux(config func(*http.ServeMux)) func(*http.Server)

func Port

func Port(labels ...string) (int, error)

func Pprof

func Pprof() func(*http.Server)

func Serve

func Serve(interupt context.Context, port int, opts ...func(*http.Server)) (context.Context, error)

func ServeHTTP added in v0.1.8

func ServeHTTP(interupt context.Context, port int, opts ...func(*http.Server)) chan error

Types

type Context

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

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

func (*Context) Err

func (c *Context) Err() error

func (*Context) Value

func (c *Context) Value(key interface{}) interface{}

Jump to

Keyboard shortcuts

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