jsonequal

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(
	lsrc func() (interface{}, []byte, error),
	rsrc func() (interface{}, []byte, error),
	options ...func(*Caller),
) bool

Equal :

func FailJSONDiff

func FailJSONDiff(
	c *Caller,
	left interface{},
	right interface{},
	lb []byte,
	rb []byte,
) error

FailJSONDiff :

func FailPlain

func FailPlain(
	c *Caller,
	left interface{},
	right interface{},
	lb []byte,
	rb []byte,
) error

FailPlain :

func From

func From(iface interface{}) func() (interface{}, []byte, error)

From :

func FromBytes

func FromBytes(b []byte) func() (interface{}, []byte, error)

FromBytes :

func FromRaw

func FromRaw(iface interface{}) func() (interface{}, []byte, error)

FromRaw :

func FromRawWithBytes

func FromRawWithBytes(iface interface{}, b []byte) func() (interface{}, []byte, error)

FromRawWithBytes :

func FromReadCloser

func FromReadCloser(reader io.ReadCloser) func() (interface{}, []byte, error)

FromReadCloser :

func FromReader

func FromReader(reader io.Reader) func() (interface{}, []byte, error)

FromReader :

func FromString

func FromString(s string) func() (interface{}, []byte, error)

FromString :

func MustNormalize

func MustNormalize(src interface{}) interface{}

MustNormalize :

func Normalize

func Normalize(src interface{}) (interface{}, error)

Normalize :

func ShouldBeSame

func ShouldBeSame(
	lsrc func() (interface{}, []byte, error),
	rsrc func() (interface{}, []byte, error),
	options ...func(*Caller),
) error

ShouldBeSame :

func WithLeftName

func WithLeftName(s string) func(*Caller)

WithLeftName :

func WithPrefix

func WithPrefix(s string) func(*Caller)

WithPrefix :

func WithRightName

func WithRightName(s string) func(*Caller)

WithRightName :

Types

type Caller

type Caller struct {
	Prefix    string
	LeftName  string
	RightName string

	EqualFunc func(left interface{}, right interface{}) bool
	WrapfFunc func(error, string) error
	FailFunc  func(caller *Caller, left interface{}, right interface{}, lb []byte, rb []byte) error
}

Caller :

Jump to

Keyboard shortcuts

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