jsoncatcher

package
v0.0.0-...-76a6b52 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package jsoncatcher compares re-emitted, parsed JSON data with its raw counterpart to find fields which have not been correctly parsed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatchOptions

type CatchOptions struct {
	// Optional func, should return true if a mismatching key should be skipped
	// (as it is parsed otherwise).
	Skip func(key []byte) bool
	// Catch will write to Missed JSON objects containing the raw unparsed
	// object, and the fields it didn't parse, in a JSON stream (ie. one per line).
	Missed io.Writer
}

CatchOptions contains options to modify the behaviour of Catch.

func (CatchOptions) Catch

func (c CatchOptions) Catch(rawOriginal []byte, parsed any) error

type ErrMissed

type ErrMissed []string

ErrMissed is returned by CatchOptions.Catch for missed fields.

func (ErrMissed) Error

func (e ErrMissed) Error() string

Jump to

Keyboard shortcuts

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