reqmatcher

package
v0.0.0-...-1568143 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedUnmarshal = status.Error(codes.Internal, "failed unmarshal response")
View Source
var ErrRuleNotFound = status.Error(codes.FailedPrecondition, "rule not found")

Functions

This section is empty.

Types

type MatchRule

type MatchRule struct {
	Request    string `json:"request"`
	Response   string `json:"response"`
	MethodName string `json:"method_name"`
}

type Matcher

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

func GetMatcher

func GetMatcher(name string) *Matcher

func NewMatcher

func NewMatcher(name string, log *zap.Logger) *Matcher

func (*Matcher) Append

func (m *Matcher) Append(rule *MatchRule)

func (*Matcher) Match

func (m *Matcher) Match(ctx context.Context, req, resp interface{}) error

func (*Matcher) Reset

func (m *Matcher) Reset()

type MetaKeyName

type MetaKeyName string
const (
	DefaultMatcher             = "default"
	MetaKey        MetaKeyName = "meta"
)

type RequestMeta

type RequestMeta struct {
	Method string
}

Jump to

Keyboard shortcuts

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