lockbox

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoerceRecord added in v0.4.0

func CoerceRecord(schema *arrow.Schema, rec arrow.Record) (arrow.Record, error)

CoerceRecord converts parquet record columns to lockbox schema order and types

func DetectCSVSchema added in v0.3.0

func DetectCSVSchema(path string, sample int) (*arrow.Schema, error)

DetectCSVSchema reads a CSV file and attempts to infer an Arrow schema. It reads up to sample records to determine column types.

Types

type Info

type Info struct {
	Version     uint32        `json:"version"`
	Schema      *arrow.Schema `json:"-"`
	CreatedAt   interface{}   `json:"createdAt"`
	CreatedBy   string        `json:"createdBy"`
	ModifiedAt  interface{}   `json:"modifiedAt"`
	ModifiedBy  string        `json:"modifiedBy"`
	BlockCount  int           `json:"blockCount"`
	AccessCount int           `json:"accessCount"`
}

Info represents information about a lockbox file

type Lockbox

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

Lockbox represents a lockbox file with high-level operations

func Create

func Create(filename string, schema *arrow.Schema, opts ...Option) (*Lockbox, error)

Create creates a new lockbox file with the given schema

func Open

func Open(filename string, opts ...Option) (*Lockbox, error)

Open opens an existing lockbox file

func (*Lockbox) Close

func (lb *Lockbox) Close() error

Close closes the lockbox file

func (*Lockbox) GetBlob added in v0.3.0

func (lb *Lockbox) GetBlob(field string, row int, opts ...Option) ([]byte, error)

GetBlob returns the blob data for the given field and row index.

func (*Lockbox) Info

func (lb *Lockbox) Info() (*Info, error)

Info returns information about the lockbox file

func (*Lockbox) IngestParquet added in v0.3.0

func (lb *Lockbox) IngestParquet(ctx context.Context, path string, opts ...Option) error

IngestParquet ingests a Parquet file into the lockbox

func (*Lockbox) IngestParquetAsync added in v0.3.0

func (lb *Lockbox) IngestParquetAsync(ctx context.Context, path string, opts ...Option) <-chan error

IngestParquetAsync runs IngestParquet in a goroutine

func (*Lockbox) Query

func (lb *Lockbox) Query(ctx context.Context, query string, opts ...Option) (arrow.Record, error)

Query performs a simple query on the lockbox data This is a basic implementation that reads all data and applies simple filters query-engine

func (*Lockbox) Read

func (lb *Lockbox) Read(ctx context.Context, opts ...Option) (arrow.Record, error)

Read reads an Arrow record from the lockbox

func (*Lockbox) ReadAsync added in v0.3.0

func (lb *Lockbox) ReadAsync(ctx context.Context, opts ...Option) (<-chan arrow.Record, <-chan error)

ReadAsync performs Read in a separate goroutine

func (*Lockbox) Repair added in v0.3.0

func (lb *Lockbox) Repair() error

Repair attempts to remove corrupted blocks and update metadata

func (*Lockbox) Schema

func (lb *Lockbox) Schema() *arrow.Schema

Schema returns the Arrow schema of the lockbox

func (*Lockbox) Validate added in v0.3.0

func (lb *Lockbox) Validate() error

Validate verifies the integrity of the lockbox data blocks

func (*Lockbox) Write

func (lb *Lockbox) Write(ctx context.Context, record arrow.Record, opts ...Option) error

Write writes an Arrow record to the lockbox

func (*Lockbox) WriteAsync added in v0.3.0

func (lb *Lockbox) WriteAsync(ctx context.Context, record arrow.Record, opts ...Option) <-chan error

WriteAsync performs Write in a separate goroutine

type Option

type Option func(*Options)

Option is a functional option for lockbox operations

func WithColumns

func WithColumns(columns ...string) Option

WithColumns sets the specific columns to operate on

func WithCreatedBy

func WithCreatedBy(createdBy string) Option

WithCreatedBy sets the creator name for lockbox operations

func WithCryptoModule added in v0.3.0

func WithCryptoModule(name string) Option

WithCryptoModule selects the cryptographic module by name.

func WithDryRun added in v0.3.0

func WithDryRun(v bool) Option

WithDryRun enables or disables dry-run mode

func WithPassword

func WithPassword(password string) Option

WithPassword sets the password for lockbox operations

type Options

type Options struct {
	Password     string
	CreatedBy    string
	Columns      []string
	DryRun       bool
	CryptoModule string
}

Options for lockbox operations

Jump to

Keyboard shortcuts

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