mul

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReaderClosed  = errors.New("mul reader is closed")
	ErrOutOfBounds   = errors.New("read operation would exceed file bounds")
	ErrInvalidIndex  = errors.New("invalid index")
	ErrInvalidOffset = errors.New("invalid offset")
	ErrInvalidEntry  = errors.New("invalid entry")
)

Errors

Functions

This section is empty.

Types

type AddFn

type AddFn = func(id, offset, length, extra uint32, value []byte)

type Entry

type Entry = interface {
	io.ReaderAt
	Len() int
	Extra() uint64
}

type Entry3D

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

Entry3D represents an entry in MUL index files

type Option

type Option func(*Reader)

Option represents a configuration option for MulReader

func WithChunks

func WithChunks(chunkSize int) Option

WithChunks configures the reader to handle files with fixed-size chunks

func WithDecode

func WithDecode(fn func(file *mmap.File, add AddFn) error) Option

WithDecode sets a custom parser function for the reader

func WithEntrySize

func WithEntrySize(size int) Option

WithEntrySize sets the size of each entry in the index file

type Reader

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

Reader provides access to MUL file data

func Open

func Open(mulFilename, idxFilename string, options ...Option) (*Reader, error)

Open creates a new MUL reader with a separate index file

func OpenOne

func OpenOne(filename string, options ...Option) (*Reader, error)

OpenOne creates and initializes a new MUL reader

func (*Reader) Close

func (r *Reader) Close() error

Close releases resources

func (*Reader) Entries

func (r *Reader) Entries() iter.Seq[uint32]

Entries returns an iterator over available entries

func (*Reader) Entry

func (r *Reader) Entry(key uint32) (Entry, error)

Entry returns an entry reader

Jump to

Keyboard shortcuts

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