internal

package
v0.4.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Counter added in v0.3.0

func Counter(start int) iter.Seq[int]

func DecimalRequiredBytes added in v0.2.0

func DecimalRequiredBytes(precision int) int

DecimalRequiredBytes returns the required number of bytes to store a decimal value of the given precision. If the precision is outside the range (0, 40], this returns -1 as it is invalid.

func DecimalSchema added in v0.2.0

func DecimalSchema(precision, scale int) avro.Schema

func Difference added in v0.2.0

func Difference(a, b []string) []string

Helper function to find the difference between two slices (a - b).

func Must added in v0.2.0

func Must[T any](v T, err error) T

func NewManifestEntrySchema added in v0.2.0

func NewManifestEntrySchema(partitionType avro.Schema, version int) (avro.Schema, error)

func NewManifestFileSchema added in v0.2.0

func NewManifestFileSchema(version int) (avro.Schema, error)

func NullableSchema added in v0.2.0

func NullableSchema(schema avro.Schema) avro.Schema

func PackingIterator added in v0.3.0

func PackingIterator[T any](itr iter.Seq[T], targetWeight int64, lookback int, weightFunc func(T) int64, largestBinFirst bool) iter.Seq[[]T]

func RecoverError added in v0.2.0

func RecoverError(err *error)

func WithElementID added in v0.2.0

func WithElementID(id int) avro.SchemaOption

func WithFieldID added in v0.2.0

func WithFieldID(id int) avro.SchemaOption

Types

type Bin added in v0.2.0

type Bin[T any] struct {
	// contains filtered or unexported fields
}

func (*Bin[T]) Add added in v0.2.0

func (b *Bin[T]) Add(item T, weight int64)

func (*Bin[T]) CanAdd added in v0.2.0

func (b *Bin[T]) CanAdd(weight int64) bool

func (*Bin[T]) Weight added in v0.2.0

func (b *Bin[T]) Weight() int64

type CountingWriter added in v0.2.0

type CountingWriter struct {
	Count int64
	W     io.Writer
}

func (*CountingWriter) Write added in v0.2.0

func (w *CountingWriter) Write(p []byte) (int, error)

type MockFS

type MockFS struct {
	mock.Mock
}

func (*MockFS) Create added in v0.2.0

func (m *MockFS) Create(name string) (io.FileWriter, error)

func (*MockFS) Open

func (m *MockFS) Open(name string) (io.File, error)

func (*MockFS) Remove

func (m *MockFS) Remove(name string) error

func (*MockFS) WriteFile added in v0.2.0

func (m *MockFS) WriteFile(name string, content []byte) error

type MockFSReadFile

type MockFSReadFile struct {
	MockFS
}

func (*MockFSReadFile) ReadFile

func (m *MockFSReadFile) ReadFile(name string) ([]byte, error)

type MockFile

type MockFile struct {
	Contents *bytes.Reader
	// contains filtered or unexported fields
}

func (*MockFile) Close

func (m *MockFile) Close() error

func (*MockFile) Read

func (m *MockFile) Read(p []byte) (int, error)

func (*MockFile) ReadAt

func (m *MockFile) ReadAt(p []byte, off int64) (n int, err error)

func (*MockFile) Seek

func (m *MockFile) Seek(offset int64, whence int) (n int64, err error)

func (*MockFile) Stat

func (m *MockFile) Stat() (fs.FileInfo, error)

type SlicePacker added in v0.2.0

type SlicePacker[T any] struct {
	TargetWeight    int64
	Lookback        int
	LargestBinFirst bool
}

func (*SlicePacker[T]) Pack added in v0.2.0

func (s *SlicePacker[T]) Pack(items []T, weightFunc func(T) int64) [][]T

func (*SlicePacker[T]) PackEnd added in v0.2.0

func (s *SlicePacker[T]) PackEnd(items []T, weightFunc func(T) int64) [][]T

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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