Documentation
¶
Index ¶
- Variables
- func CheckedClose(c io.Closer, err *error)
- func Counter(start int) iter.Seq[int]
- func DecimalRequiredBytes(precision int) int
- func DecimalSchema(precision, scale int) avro.Schema
- func Difference(a, b []string) []string
- func Must[T any](v T, err error) T
- func NewManifestEntrySchema(partitionType avro.Schema, version int) (avro.Schema, error)
- func NewManifestFileSchema(version int) (avro.Schema, error)
- func NullableSchema(schema avro.Schema) avro.Schema
- func PackingIterator[T any](itr iter.Seq[T], targetWeight int64, lookback int, weightFunc func(T) int64, ...) iter.Seq[[]T]
- func RecoverError(err *error)
- func WithElementID(id int) avro.SchemaOption
- func WithFieldID(id int) avro.SchemaOption
- type Bin
- type CountingWriter
- type MockFS
- type MockFSReadFile
- type MockFile
- func (m *MockFile) Close() error
- func (m *MockFile) Read(p []byte) (int, error)
- func (m *MockFile) ReadAt(p []byte, off int64) (n int, err error)
- func (m *MockFile) ReadFrom(r sio.Reader) (n int64, err error)
- func (m *MockFile) Seek(offset int64, whence int) (n int64, err error)
- func (m *MockFile) Stat() (fs.FileInfo, error)
- func (m *MockFile) Write(p []byte) (n int, err error)
- type SlicePacker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NullSchema = avro.NewNullSchema() BoolSchema = avro.NewPrimitiveSchema(avro.Boolean, nil) NullableBoolSchema = NullableSchema(BoolSchema) BinarySchema = avro.NewPrimitiveSchema(avro.Bytes, nil) NullableBinarySchema = NullableSchema(BinarySchema) StringSchema = avro.NewPrimitiveSchema(avro.String, nil) IntSchema = avro.NewPrimitiveSchema(avro.Int, nil) NullableIntSchema = NullableSchema(IntSchema) LongSchema = avro.NewPrimitiveSchema(avro.Long, nil) NullableLongSchema = NullableSchema(LongSchema) FloatSchema = avro.NewPrimitiveSchema(avro.Float, nil) DoubleSchema = avro.NewPrimitiveSchema(avro.Double, nil) DateSchema = avro.NewPrimitiveSchema(avro.Int, avro.NewPrimitiveLogicalSchema(avro.Date)) TimeSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimeMicros)) TimestampSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimestampMicros), avro.WithProps(map[string]any{"adjust-to-utc": false})) TimestampTzSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimestampMicros), avro.WithProps(map[string]any{"adjust-to-utc": true})) UUIDSchema = Must(avro.NewFixedSchema("uuid", "", 16, avro.NewPrimitiveLogicalSchema(avro.UUID))) AvroSchemaCache avro.SchemaCache )
Functions ¶
func CheckedClose ¶ added in v0.4.0
CheckedClose is a helper function to close a resource and return an error if it fails. It is intended to be used in a defer statement.
func DecimalRequiredBytes ¶ added in v0.2.0
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 Difference ¶ added in v0.2.0
Helper function to find the difference between two slices (a - b).
func NewManifestEntrySchema ¶ added in v0.2.0
func NewManifestFileSchema ¶ added in v0.2.0
func PackingIterator ¶ added in v0.3.0
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 CountingWriter ¶ added in v0.2.0
type MockFSReadFile ¶
type MockFile ¶
type MockFile struct {
Contents *bytes.Reader
ErrOnClose bool
// contains filtered or unexported fields
}
type SlicePacker ¶ added in v0.2.0
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
Click to show internal directories.
Click to hide internal directories.