Documentation
¶
Index ¶
- func AssertJSONEq(t assert.TestingT, expected string, actual string, msgAndArgs ...interface{}) bool
- func JsonEqual(a, b []byte) (bool, error)
- func ModifyJson(data []byte, opts ...JsonModifierOption) ([]byte, error)
- func NewJsonParser(data []byte, handler jsonParserHandler) *jsonParser
- func NewJsonTokenizer(data []byte) *jsonTokenizer
- func RequireJSONEq(t assert.TestingT, expected string, actual string, msgAndArgs ...interface{})
- type HandlerContext
- type JsonModifier
- type JsonModifierOption
- type JsonNullFilter
- type Kind
- type TokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertJSONEq ¶ added in v0.3.1
func AssertJSONEq(t assert.TestingT, expected string, actual string, msgAndArgs ...interface{}) bool
AssertJSONEq asserts that two JSON strings are equivalent.
AssertJSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func ModifyJson ¶
func ModifyJson(data []byte, opts ...JsonModifierOption) ([]byte, error)
func NewJsonParser ¶
func NewJsonParser(data []byte, handler jsonParserHandler) *jsonParser
func NewJsonTokenizer ¶
func NewJsonTokenizer(data []byte) *jsonTokenizer
Types ¶
type HandlerContext ¶ added in v0.2.2
type JsonModifier ¶ added in v0.2.3
type JsonModifier struct {
// contains filtered or unexported fields
}
func NewJsonModifier ¶ added in v0.2.3
func NewJsonModifier(opts ...JsonModifierOption) *JsonModifier
func (*JsonModifier) ModifyJson ¶ added in v0.2.3
func (m *JsonModifier) ModifyJson(data []byte) ([]byte, error)
type JsonModifierOption ¶ added in v0.2.4
type JsonModifierOption func(*JsonModifier)
func WithFieldLengthLimit ¶
func WithFieldLengthLimit(limit int) JsonModifierOption
func WithFilterKeys ¶ added in v0.2.2
func WithFilterKeys(keys ...string) JsonModifierOption
func WithInplace ¶
func WithInplace(inplace bool) JsonModifierOption
type JsonNullFilter ¶ added in v0.3.0
type JsonNullFilter struct {
// contains filtered or unexported fields
}
func NewJsonNullFilter ¶ added in v0.3.0
func NewJsonNullFilter(inplace bool) *JsonNullFilter
Click to show internal directories.
Click to hide internal directories.