compare

package
v0.0.0-...-49bc7a0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

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

func NewComparator

func NewComparator(parser Parser, opts ...Option) Comparator

func (Comparator) Equal

func (c Comparator) Equal(source, target interface{}) bool

type DefaultParser

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

func (DefaultParser) Get

func (p DefaultParser) Get(path string) interface{}

func (DefaultParser) Json

func (p DefaultParser) Json() string

func (DefaultParser) Parse

func (p DefaultParser) Parse(obj interface{}) Parser

func (DefaultParser) Set

func (p DefaultParser) Set(path string, value interface{})

type None

type None struct{}

None Value of empty

type Option

type Option func(*Comparator)

func ExcludeField

func ExcludeField(field string) Option

func FiledPathMap

func FiledPathMap(source, target string) Option

func IncludeField

func IncludeField(field string) Option

type Parser

type Parser interface {
	// Parse covert object to Parser
	Parse(interface{}) Parser
	Get(path string) interface{}
	Set(path string, val interface{})
	// Json covert object to json string
	Json() string
}

Jump to

Keyboard shortcuts

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