matchers

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyMatcher

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

func Any

func Any(paths ...string) *AnyMatcher

func (*AnyMatcher) ErrOnMissingPath

func (a *AnyMatcher) ErrOnMissingPath(e bool) *AnyMatcher

func (*AnyMatcher) JSON

func (a *AnyMatcher) JSON(s []byte) ([]byte, []MatcherError)

func (*AnyMatcher) Placeholder

func (a *AnyMatcher) Placeholder(p any) *AnyMatcher

type CustomCallback

type CustomCallback func(val any) (any, error)

type CustomMatcher

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

func Custom

func Custom(path string, callback CustomCallback) *CustomMatcher

func (*CustomMatcher) ErrOnMissingPath

func (c *CustomMatcher) ErrOnMissingPath(e bool) *CustomMatcher

func (*CustomMatcher) JSON

func (c *CustomMatcher) JSON(s []byte) ([]byte, []MatcherError)

type JsonMatcher

type JsonMatcher interface {
	JSON([]byte) ([]byte, []MatcherError)
}

type MatcherError

type MatcherError struct {
	Reason  error
	Matcher string
	Path    string
}

type TypeMatcher

type TypeMatcher[ExpectedType any] struct {
	// contains filtered or unexported fields
}

func Type

func Type[ExpectedType any](paths ...string) *TypeMatcher[ExpectedType]

func (*TypeMatcher[T]) ErrOnMissingPath

func (t *TypeMatcher[T]) ErrOnMissingPath(e bool) *TypeMatcher[T]

func (*TypeMatcher[ExpectedType]) JSON

func (t *TypeMatcher[ExpectedType]) JSON(s []byte) ([]byte, []MatcherError)

Jump to

Keyboard shortcuts

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