Documentation ¶
Index ¶
- type DerivedField
- type Table
- func (t *Table) CheckRowEligibility(row int, filters []govaluate.EvaluableExpression) (bool, error)
- func (t *Table) GenerateDerivedValues(row int, fields []DerivedField) (map[string]float64, error)
- func (t *Table) HasRequiredFields(requestedFields []string) error
- func (t *Table) LinkFromRow(row int) (*cube.Link, error)
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 ¶
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 ¶
HasRequiredFields determines whether the Table has the specified requested fields. Returns nil on success, otherwise returns an errors detailing the missing fields.