method

package
v0.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMethodWithConfig

func NewMethodWithConfig(conf *Config) (http.Handler, error)

Types

type Config

type Config struct {
	Methods  []*Route
	NotFound http.Handler
}

type Method

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

Method is an host multiplexer.

func NewMethod

func NewMethod() *Method

func (*Method) Handle

func (m *Method) Handle(method string, handler http.Handler)

func (*Method) Handler

func (m *Method) Handler(method string) (handler http.Handler)

Handler returns methods route handler.

func (*Method) NotFound

func (m *Method) NotFound(handler http.Handler)

func (*Method) ServeHTTP

func (m *Method) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type MethodEnum

type MethodEnum string
const (
	MethodGet     MethodEnum = "GET"
	MethodHead    MethodEnum = "HEAD"
	MethodPost    MethodEnum = "POST"
	MethodPut     MethodEnum = "PUT"
	MethodPatch   MethodEnum = "PATCH"
	MethodDelete  MethodEnum = "DELETE"
	MethodConnect MethodEnum = "CONNECT"
	MethodOptions MethodEnum = "OPTIONS"
	MethodTrace   MethodEnum = "TRACE"
)

type Route

type Route struct {
	Method  MethodEnum
	Handler http.Handler
}

Jump to

Keyboard shortcuts

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