goweb

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

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

Some small helper functions for web/http based go code.

The ReMux code (remux.go) is taken from git.ligo.org/jonathan-hanks/cds_metadata_server/ which is gpl 3.

This code is hence under GPL 3.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(handler http.HandlerFunc, generators ...Generator) http.HandlerFunc

func Logging

func Logging() bool

func LoggingMiddleware

func LoggingMiddleware(handlerFunc http.HandlerFunc) http.HandlerFunc

func NewLoggingMiddleware

func NewLoggingMiddleware(next http.HandlerFunc) http.HandlerFunc

func NewPanicHandler

func NewPanicHandler(next http.HandlerFunc) http.HandlerFunc

func ReMuxParams

func ReMuxParams(r *http.Request) map[string]string

Types

type Generator

type Generator func(handlerFunc http.HandlerFunc) http.HandlerFunc

type HandlerInfo

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

func (*HandlerInfo) Methods

func (hi *HandlerInfo) Methods(methods ...string) *HandlerInfo

func (*HandlerInfo) Name

func (hi *HandlerInfo) Name(name string) *HandlerInfo

func (*HandlerInfo) Values

func (hi *HandlerInfo) Values(pairs ...KeyValPair) *HandlerInfo

type KeyValPair

type KeyValPair struct {
	Key interface{}
	Val interface{}
}

type ReMux

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

func NewReMux

func NewReMux() *ReMux

func (*ReMux) HandleFunc

func (r *ReMux) HandleFunc(path string, handler http.HandlerFunc) *HandlerInfo

func (*ReMux) Reverse

func (r *ReMux) Reverse(name string, params map[string]string) (string, error)

func (*ReMux) ServeHTTP

func (r *ReMux) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type ReMuxMethodsKey

type ReMuxMethodsKey struct{}

type ReMuxParamsKey

type ReMuxParamsKey struct{}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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