Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoundedSource ¶
type BoundedSource struct {
// contains filtered or unexported fields
}
BoundedSource exposes a [start,end) view over a base source. Reads and lengths are expressed in local coordinates.
func NewBounded ¶
func NewBounded(base Source, start, end int64) (*BoundedSource, error)
NewBounded is part of the experimental JSONKit API.
func (*BoundedSource) BaseEnd ¶
func (s *BoundedSource) BaseEnd() int64
func (*BoundedSource) BaseStart ¶
func (s *BoundedSource) BaseStart() int64
func (*BoundedSource) Len ¶
func (s *BoundedSource) Len() int64
func (*BoundedSource) Name ¶
func (s *BoundedSource) Name() string
type BufferedSource ¶
type BufferedSource struct {
// contains filtered or unexported fields
}
BufferedSource reduces repeated small ReadAt calls by caching a fixed-size window from an underlying source.
func NewBuffered ¶
func NewBuffered(base Source, blockSize int64) *BufferedSource
NewBuffered wraps base with a block cache. Non-positive blockSize falls back to a default.
func (*BufferedSource) Len ¶
func (s *BufferedSource) Len() int64
func (*BufferedSource) Name ¶
func (s *BufferedSource) Name() string
func (*BufferedSource) Revision ¶
func (s *BufferedSource) Revision() Revision
type BytesSource ¶
type BytesSource struct {
// contains filtered or unexported fields
}
BytesSource is part of the experimental JSONKit API.
func ApplyEdits ¶
func ApplyEdits(src Source, edits []Edit) (*BytesSource, error)
ApplyEdits requires edits to be pre-sorted by (Start, End). Overlapping edits are rejected.
Returned revision policy: - input implements Revisioned: output revision is input.Revision()+1 - input does not implement Revisioned: output revision is 0
func NewBytes ¶
func NewBytes(name string, b []byte) *BytesSource
NewBytes is part of the experimental JSONKit API.
func (*BytesSource) Bytes ¶
func (s *BytesSource) Bytes() []byte
Bytes returns the underlying immutable byte slice view. Callers must treat this as read-only.
func (*BytesSource) Len ¶
func (s *BytesSource) Len() int64
func (*BytesSource) Name ¶
func (s *BytesSource) Name() string
func (*BytesSource) Revision ¶
func (s *BytesSource) Revision() Revision
type EditError ¶
type EditError struct {
Kind EditErrorKind
Edit Edit
Index int
Detail string
}
EditError is part of the experimental JSONKit API.
type EditErrorKind ¶
type EditErrorKind uint8
EditErrorKind is part of the experimental JSONKit API.
const ( // EditErrorNegativeOffset is an experimental JSONKit constant. EditErrorNegativeOffset EditErrorKind = iota + 1 // EditErrorInvertedRange is an experimental JSONKit constant. EditErrorInvertedRange // EditErrorOutOfBounds is an experimental JSONKit constant. EditErrorOutOfBounds // EditErrorUnsorted is an experimental JSONKit constant. EditErrorUnsorted // EditErrorOverlap is an experimental JSONKit constant. EditErrorOverlap // EditErrorNilSource is an experimental JSONKit constant. EditErrorNilSource )
func (EditErrorKind) String ¶
func (k EditErrorKind) String() string
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
FileSource is a file-backed source that reads directly from an open file. The owner must call Close when finished.
func OpenFile ¶
func OpenFile(path string) (*FileSource, error)
OpenFile is part of the experimental JSONKit API.
func (*FileSource) Close ¶
func (s *FileSource) Close() error
func (*FileSource) Len ¶
func (s *FileSource) Len() int64
func (*FileSource) Name ¶
func (s *FileSource) Name() string
func (*FileSource) Revision ¶
func (s *FileSource) Revision() Revision
type RangeError ¶
type RangeError struct {
Kind RangeErrorKind
Start int64
End int64
Len int64
}
RangeError is part of the experimental JSONKit API.
func (*RangeError) Error ¶
func (e *RangeError) Error() string
type RangeErrorKind ¶
type RangeErrorKind uint8
RangeErrorKind is part of the experimental JSONKit API.
const ( // RangeErrorNilSource is an experimental JSONKit constant. RangeErrorNilSource RangeErrorKind = iota + 1 // RangeErrorNegativeOffset is an experimental JSONKit constant. RangeErrorNegativeOffset // RangeErrorStartAfterEnd is an experimental JSONKit constant. RangeErrorStartAfterEnd // RangeErrorOutOfBounds is an experimental JSONKit constant. RangeErrorOutOfBounds )
func (RangeErrorKind) String ¶
func (k RangeErrorKind) String() string
type Revisioned ¶
type Revisioned interface {
Revision() Revision
}
Revisioned is part of the experimental JSONKit API.
type Source ¶
Source is part of the experimental JSONKit API.
func WrapBuffered ¶
WrapBuffered returns base unchanged for nil, byte-backed, and already buffered sources; otherwise it applies default buffering.