package method

import "github.com/google/martian/v3/method"

Package method provides utilities for working with request methods.

Index

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.

Source Files

method_filter.go method_verifier.go

Version
v3.3.3 (latest)
Published
Aug 16, 2022
Platform
darwin/amd64
Imports
9 packages
Last checked
3 hours ago

Tools for package owners.