Documentation
¶
Index ¶
- Constants
- type AbsentValue
- type Comparator
- type DiffItem
- type DiffResult
- type JsonDiffItem
- type JsonDiffResult
- type JsonDiffer
- type JsonPath
- type JsonPathConfig
- func (c *JsonPathConfig) IgnoreArrayOrder() *JsonPathConfig
- func (c *JsonPathConfig) IgnoreExtraItems() *JsonPathConfig
- func (c *JsonPathConfig) IgnorePath() *JsonPathConfig
- func (c *JsonPathConfig) IgnoreValue() *JsonPathConfig
- func (c *JsonPathConfig) SetComparator(comparator Comparator) *JsonPathConfig
- func (c *JsonPathConfig) TreatNullAsAbsent() *JsonPathConfig
- func (c *JsonPathConfig) UnquoteExpand() *JsonPathConfig
- type MatchResult
- type Strategy
- type UnquoteString
- type ValueDiffer
- type XmlDiffItem
- type XmlDiffResult
- type XmlDiffer
Constants ¶
View Source
const ( MatchNone = MatchResult(0) // 匹配失败 MatchPrefix = MatchResult(1) // 前缀匹配 MatchFull = MatchResult(2) // 全部匹配 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbsentValue ¶
type AbsentValue string
type DiffResult ¶
type JsonDiffItem ¶
type JsonDiffResult ¶
type JsonDiffResult struct {
Differs map[string]JsonDiffItem
Ignores map[string]JsonDiffItem
Equals map[string]JsonDiffItem
}
func DiffJSON ¶
func DiffJSON(a, b string, configs ...*JsonPathConfig) *JsonDiffResult
DiffJSON 比较 a,b 两个 JSON 字符串,返回它们异同之处。
type JsonDiffer ¶
type JsonDiffer struct {
// contains filtered or unexported fields
}
JsonDiffer JSON 比较器。
func (*JsonDiffer) Diff ¶
func (d *JsonDiffer) Diff(a, b string) *JsonDiffResult
Diff 比较 a,b 两个 JSON 字符串,返回它们异同之处。
type JsonPath ¶
type JsonPath interface {
Match(path string) MatchResult
}
JsonPath 使用 JSON 路径表达式定义的路径。
type JsonPathConfig ¶
type JsonPathConfig struct {
// contains filtered or unexported fields
}
func ConfigJsonPath ¶
func ConfigJsonPath(path JsonPath) *JsonPathConfig
func (*JsonPathConfig) IgnoreArrayOrder ¶
func (c *JsonPathConfig) IgnoreArrayOrder() *JsonPathConfig
func (*JsonPathConfig) IgnoreExtraItems ¶
func (c *JsonPathConfig) IgnoreExtraItems() *JsonPathConfig
func (*JsonPathConfig) IgnorePath ¶
func (c *JsonPathConfig) IgnorePath() *JsonPathConfig
func (*JsonPathConfig) IgnoreValue ¶
func (c *JsonPathConfig) IgnoreValue() *JsonPathConfig
func (*JsonPathConfig) SetComparator ¶
func (c *JsonPathConfig) SetComparator(comparator Comparator) *JsonPathConfig
func (*JsonPathConfig) TreatNullAsAbsent ¶
func (c *JsonPathConfig) TreatNullAsAbsent() *JsonPathConfig
func (*JsonPathConfig) UnquoteExpand ¶
func (c *JsonPathConfig) UnquoteExpand() *JsonPathConfig
type UnquoteString ¶
type UnquoteString string
type ValueDiffer ¶
type ValueDiffer struct {
}
ValueDiffer 值比较器。
func (*ValueDiffer) Diff ¶
func (d *ValueDiffer) Diff(a, b interface{}) *DiffResult
Diff 比较 a,b 两个任意值,返回它们异同之处。
type XmlDiffItem ¶
type XmlDiffItem struct {
A interface{}
B interface{}
}
type XmlDiffResult ¶
type XmlDiffResult struct {
Differs map[string]XmlDiffItem
Ignores map[string]XmlDiffItem
Equals map[string]XmlDiffItem
}
Click to show internal directories.
Click to hide internal directories.