internal

package
v0.0.0-...-7dcd445 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(httprouter.Handle) httprouter.Handle

Middleware ...

type Router

type Router struct {
	httprouter.Router
	// contains filtered or unexported fields
}

Router ...

func NewRouter

func NewRouter() *Router

NewRouter ...

func (*Router) DELETE

func (r *Router) DELETE(path string, handle httprouter.Handle)

DELETE is a shortcut for Router.Handle("DELETE", path, handle)

func (*Router) File

func (r *Router) File(path, name string)

File serves the named file.

func (*Router) GET

func (r *Router) GET(path string, handle httprouter.Handle)

GET is a shortcut for Router.Handle("GET", path, handle)

func (*Router) Group

func (r *Router) Group(path string, m ...Middleware) *Router

Group returns new *Router with given path and middlewares. It should be used for handles which have same path prefix or common middlewares.

func (*Router) HEAD

func (r *Router) HEAD(path string, handle httprouter.Handle)

HEAD is a shortcut for Router.Handle("HEAD", path, handle)

func (*Router) Handle

func (r *Router) Handle(method, path string, handle httprouter.Handle)

Handle registers a new request handle combined with middlewares.

func (*Router) Handler

func (r *Router) Handler(method, path string, handler http.Handler)

Handler is an adapter for http.Handler.

func (*Router) HandlerFunc

func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc)

HandlerFunc is an adapter for http.HandlerFunc.

func (*Router) OPTIONS

func (r *Router) OPTIONS(path string, handle httprouter.Handle)

OPTIONS is a shortcut for Router.Handle("OPTIONS", path, handle)

func (*Router) PATCH

func (r *Router) PATCH(path string, handle httprouter.Handle)

PATCH is a shortcut for Router.Handle("PATCH", path, handle)

func (*Router) POST

func (r *Router) POST(path string, handle httprouter.Handle)

POST is a shortcut for Router.Handle("POST", path, handle)

func (*Router) PUT

func (r *Router) PUT(path string, handle httprouter.Handle)

PUT is a shortcut for Router.Handle("PUT", path, handle)

func (*Router) ServeFiles

func (r *Router) ServeFiles(path string, root http.FileSystem)

ServeFiles ...

func (*Router) ServeFilesWithCacheControl

func (r *Router) ServeFilesWithCacheControl(path string, root fs.FS)

ServeFilesWithCacheControl ...

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Router) Static

func (r *Router) Static(path, root string)

Static serves files from given root directory.

func (*Router) Use

func (r *Router) Use(m ...Middleware) *Router

Use appends new middleware to current Router.

type Server

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

Server ...

func NewServer

func NewServer(bind string) *Server

NewServer ...

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe ...

Jump to

Keyboard shortcuts

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