match

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMatchFnInvalidArg = errors.New("match fn invalid arg")
)
View Source
var (
	ErrNotEq = errors.New("match not eq")
)

Functions

This section is empty.

Types

type DeepEqualType

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

func DeepEqual

func DeepEqual(exp interface{}) *DeepEqualType

func (*DeepEqualType) Match

func (m *DeepEqualType) Match(got interface{}) error

type DiffType

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

func Diff

func Diff(exp interface{}) *DiffType

func (*DiffType) Match

func (m *DiffType) Match(got interface{}) error

type FnType

type FnType struct {
	Args []interface{}
}

func Fn

func Fn(args ...interface{}) *FnType

func (*FnType) Match

func (m *FnType) Match(err error, got interface{}) error

func (*FnType) Validate

func (m *FnType) Validate() error

type GRPCErrType

type GRPCErrType struct {
	Code    codes.Code
	Message string
}

func GRPCErr

func GRPCErr(code codes.Code, msg string) *GRPCErrType

func GRPCStatusCode

func GRPCStatusCode(code codes.Code) *GRPCErrType

func (*GRPCErrType) Match

func (m *GRPCErrType) Match(err error) error

type Matcher

type Matcher interface {
	Match(error, interface{}) error
	Validate() error
}

type PayloadMatcher

type PayloadMatcher struct {
	Exp interface{}
}

func Payload

func Payload(message interface{}) *PayloadMatcher

func (*PayloadMatcher) Match

func (m *PayloadMatcher) Match(err error, got interface{}) error

func (*PayloadMatcher) Validate

func (m *PayloadMatcher) Validate() error

type ProtoEqualType

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

func ProtoEqual

func ProtoEqual(exp interface{}) *ProtoEqualType

func (*ProtoEqualType) Match

func (m *ProtoEqualType) Match(got interface{}) error

type TypeT

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

func Type

func Type(expectedMessageType interface{}) *TypeT

func (*TypeT) Match

func (m *TypeT) Match(receiveMessageType interface{}) error

Jump to

Keyboard shortcuts

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