method

package
v3.3.34 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package method provides utilities for working with request methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVerifier

func NewVerifier(method string) (verify.RequestVerifier, error)

NewVerifier returns a new method verifier.

Types

type Filter

type Filter struct {
	*filter.Filter
}

Filter runs modifier iff the request method matches the specified method.

func NewFilter

func NewFilter(meth string) *Filter

NewFilter constructs a filter that applies the modifer when the request method matches meth.

type Matcher

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

Matcher is a conditional evaluator of request methods to be used in filters that take conditionals.

func NewMatcher

func NewMatcher(method string) *Matcher

NewMatcher builds a new method matcher.

func (*Matcher) MatchRequest

func (m *Matcher) MatchRequest(req *http.Request) bool

MatchRequest retuns true if m.method matches the request method.

func (*Matcher) MatchResponse

func (m *Matcher) MatchResponse(res *http.Response) bool

MatchResponse retuns true if m.method matches res.Request.Method.

Jump to

Keyboard shortcuts

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