mux

package
v3.8.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssureContentType

func AssureContentType(w http.ResponseWriter, r *http.Request, ct string) bool

func AssureDecode

func AssureDecode(w http.ResponseWriter, r *http.Request, val interface{}) bool

func JsonResponse

func JsonResponse(w http.ResponseWriter, code int, obj interface{}) error

func Post

func Post(client *http.Client, path string, indata interface{}) ([]byte, error)

func TestContentType

func TestContentType(r *http.Request, ct string) (string, bool)

Types

type Mux

type Mux struct {
	logger.Logger
	*http.ServeMux
}

func New

func New(bl logger.Logger) *Mux

func (*Mux) Handle

func (m *Mux) Handle(path string, h http.HandlerFunc)

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	logger.Logger
	// contains filtered or unexported fields
}

func (*ResponseWriter) Status

func (rw *ResponseWriter) Status() int

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(buf []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(s int)

Jump to

Keyboard shortcuts

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