jsonmerger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinalReader

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

func (*FinalReader) Close

func (r *FinalReader) Close() error

func (*FinalReader) Read

func (r *FinalReader) Read(p []byte) (n int, err error)

type JSONMerger

type JSONMerger interface {
	ReadNext(io.ReadCloser) error
	Merged() io.Reader
}

func NewMerger

func NewMerger() JSONMerger

type JSONType

type JSONType int

JSONType represents the type of the json data. Only arrays and dictionaries are supported.

const (
	JSONTypeUnknown JSONType = iota
	JSONTypeArray
	JSONTypeDictionary
)

func DetectJSONType

func DetectJSONType(inputStream io.ReadCloser) (JSONType, io.ReadCloser, error)

DetectJSONType detects the type of the json data in the decoder. The decoder is expected to be at the beginning of the json data. only arrays and dictionaries are supported.

func DetectJSONTypeUnsafe

func DetectJSONTypeUnsafe(inputStream io.Reader) (JSONType, error)

DetectJSONTypeUnsafe is like DetectJSONType, but it pops off the bytes from the input stream.

type LazyTeeReader

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

LazyTeeReader is a reader that reads from the input stream and writes to the output stream. it provides the first and second readers to use. a more general version would probably just be supporting Reset() without limitation.

func NewLazyTeeReader

func NewLazyTeeReader(inputStream io.ReadCloser) *LazyTeeReader

func (*LazyTeeReader) GetFinalReader

func (r *LazyTeeReader) GetFinalReader() io.ReadCloser

GetFinalReader returns a reader that reads from the input stream, but loses the bytes that read from the original input stream. this is useful when the input stream is not needed anymore.

func (*LazyTeeReader) GetNextReader

func (r *LazyTeeReader) GetNextReader() io.Reader

GetNextReader returns a reader that reads from the input stream, in such a way that the bytes are not lost.

type UnprocessedMap

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

func NewGitHubUnprocessedMap

func NewGitHubUnprocessedMap() *UnprocessedMap

func NewUnprocessedMap

func NewUnprocessedMap(combiner unprocessedMapCombiner) *UnprocessedMap

func (*UnprocessedMap) Merged

func (m *UnprocessedMap) Merged() io.Reader

func (*UnprocessedMap) ReadNext

func (m *UnprocessedMap) ReadNext(reader io.ReadCloser) error

type UnprocessedSlice

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

func NewUnprocessedSlice

func NewUnprocessedSlice() *UnprocessedSlice

func (*UnprocessedSlice) Merged

func (slice *UnprocessedSlice) Merged() io.Reader

func (*UnprocessedSlice) ReadNext

func (slice *UnprocessedSlice) ReadNext(reader io.ReadCloser) error

Jump to

Keyboard shortcuts

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