routertest

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Criterion

type Criterion func(*Matcher)

Criterion is an argument that adds criteria to a transport request and context matcher.

type Matcher

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

Matcher is a gomock Matcher that validates transport requests with given criteria.

func NewMatcher

func NewMatcher(criteria ...Criterion) *Matcher

NewMatcher returns a pair of matchers corresponding to the arguments of GetHandler(Context, Request), for verifying that GetHandler is called with parameters that satisfy given constraints. Passing options like WithService("foo") adds constraints to the matcher.

func (*Matcher) Matches

func (m *Matcher) Matches(got interface{}) bool

Matches returns whether a transport request matches the configured criteria for the matcher.

func (*Matcher) String

func (m *Matcher) String() string

func (*Matcher) WithCaller

func (m *Matcher) WithCaller(caller string) *Matcher

WithCaller adds a constraint that the request caller must match.

func (*Matcher) WithProcedure

func (m *Matcher) WithProcedure(procedure string) *Matcher

WithProcedure adds a constraint that the request procedure must match.

func (*Matcher) WithService

func (m *Matcher) WithService(service string) *Matcher

WithService adds a constraint that the request callee must match.

Jump to

Keyboard shortcuts

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