Documentation
¶
Index ¶
- func FlattenJSON(data []byte) ([]byte, error)
- func FlattenJSONDirectoryToWriter(w io.Writer, path string) error
- func FlattenJSONStream(r io.Reader) io.Reader
- func IterateBundle(r io.Reader) iter.Seq2[int, io.Reader]
- func PackFilesToBundle(bundle string, paths []string) error
- func PackFilesToStream(w io.Writer, paths []string) error
- func UnpackBundle(r io.Reader, fnOpts ...unpackoptFunc) error
- func UnpackBundleFile(path string, fnOpts ...unpackoptFunc) error
- func WithFailOnInvalid(yesno bool) unpackoptFunc
- func WithFilePrefix(prefix string) unpackoptFunc
- func WithOutputDirectory(path string) unpackoptFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenJSON ¶
func FlattenJSONDirectoryToWriter ¶
FlattenJSONDirectoryToWriter flattens all JSON files in a directory
func FlattenJSONStream ¶
FlattenJSON flattens a JSON document into a single line, suitable to add to a jsonl file.
func IterateBundle ¶ added in v0.2.0
IterateBundle implements an iterator that returns an io.Reader for each json file contained in a bundle read from reader r. The iteraror will loop exactly once for each line in the file.
If a line contains data which cannot be parsed as json, the iterator will still loop but instead of an io.Reader the value will be nil.
func PackFilesToBundle ¶
PackFilesToStream takes a writer and writes to it the flattened versions of the JSON files passed in the paths
func PackFilesToStream ¶
PackFilesToStream takes a writer and writes to it the flattened versions of the JSON files passed in the paths
func UnpackBundle ¶
UnpackBundle reads data from the r io.Reader and writes each json document to a separate file.
func UnpackBundleFile ¶
UnpackBundleFile reads a jsonl file and extracts attestations bundled in it.
func WithFailOnInvalid ¶
func WithFailOnInvalid(yesno bool) unpackoptFunc
WithFailOnInvalid makes the extractor fail if there is an unparseable line
func WithFilePrefix ¶
func WithFilePrefix(prefix string) unpackoptFunc
WithFilePrefix specifies a prefix to use in the filenames
func WithOutputDirectory ¶
func WithOutputDirectory(path string) unpackoptFunc
WithFilePrefix specifies a prefix to use in the filenames
Types ¶
This section is empty.