router

package
v0.0.0-...-abd2dae Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpRouter *httprouter.Router

Functions

func GetHttpParam

func GetHttpParam(ctx context.Context, name string) string

func WrapperHandler

func WrapperHandler(metric metric.MetricInterface) http.Handler

WrapperHandler used to wrap web handler

Types

type MyRouter

type MyRouter struct {
	Httprouter     *httprouter.Router
	WrappedHandler http.Handler
	Options        *Options
}

func New

func New(o *Options) *MyRouter

func (*MyRouter) DELETE

func (mr *MyRouter) DELETE(path string, handle Handle)

func (*MyRouter) GET

func (mr *MyRouter) GET(path string, handle Handle)

func (*MyRouter) GETFile

func (mr *MyRouter) GETFile(path string, handle httprouter.Handle)

func (*MyRouter) OPTIONS

func (mr *MyRouter) OPTIONS(path string, handle Handle)

func (*MyRouter) PATCH

func (mr *MyRouter) PATCH(path string, handle Handle)

func (*MyRouter) POST

func (mr *MyRouter) POST(path string, handle Handle)

func (*MyRouter) PUT

func (mr *MyRouter) PUT(path string, handle Handle)

func (*MyRouter) ServeFiles

func (mr *MyRouter) ServeFiles(path string, root http.FileSystem)

func (*MyRouter) TestHack

func (mr *MyRouter) TestHack(fullPath string, handle Handle) httprouter.Handle

type Options

type Options struct {
	Prefix  string
	Timeout int
}

type WrittenResponseWriter

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

func (*WrittenResponseWriter) Write

func (w *WrittenResponseWriter) Write(b []byte) (int, error)

func (*WrittenResponseWriter) WriteHeader

func (w *WrittenResponseWriter) WriteHeader(status int)

func (*WrittenResponseWriter) Written

func (w *WrittenResponseWriter) Written() bool

Jump to

Keyboard shortcuts

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