dbf

package
v0.0.0-...-f45db20 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DerivedField

type DerivedField struct {
	*govaluate.EvaluableExpression
	Name string
}

DerivedField represents a new field that can be derived from existing DBF fields.

func NewDerivedField

func NewDerivedField(name, expression string) (*DerivedField, error)

NewDerivedField returns a DerivedField given a name and valid expression string.

type Table

type Table struct {
	*godbf.DbfTable
	FieldNames    []string
	FieldIndexMap map[string]int
	FieldTypeMap  map[string]godbf.DbaseDataType
}

Table wraps godbf's DbfTable struct with more useful fields and methods.

func NewFromFile

func NewFromFile(path string) (*Table, error)

NewFromFile initialises a new Table with a DBF file at the given path.

func (*Table) CheckRowEligibility

func (t *Table) CheckRowEligibility(
	row int, filters []govaluate.EvaluableExpression,
) (bool, error)

CheckRowEligibility determines whether a row would pass or fail a given set of filter expressions.

func (*Table) GenerateDerivedValues

func (t *Table) GenerateDerivedValues(
	row int, fields []DerivedField,
) (map[string]float64, error)

GenerateDerivedValues returns a mapping of new fields to derived values based on the supplied derived field specifications.

func (*Table) HasRequiredFields

func (t *Table) HasRequiredFields(requestedFields []string) error

HasRequiredFields determines whether the Table has the specified requested fields. Returns nil on success, otherwise returns an errors detailing the missing fields.

func (*Table) LinkFromRow

func (t *Table) LinkFromRow(row int) (*cube.Link, error)

LinkFromRow returns a Link derived from the A/B nodes in a row of a table if those fields exist.

Jump to

Keyboard shortcuts

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