distil: github.com/mattevans/distil Index | Files

package distil

import "github.com/mattevans/distil"

Index

Package Files

contains.go dataset.go distiller.go eq.go gt.go gteq.go is_false.go is_null.go is_true.go lt.go lteq.go matches.go not_contains.go not_eq.go not_matches.go not_null.go processor.go query.go starts_with.go

type Dataset Uses

type Dataset struct {
    Rows []map[string]interface{}
}

Dataset holds our raw data that filters will be applied against.

func NewDataset Uses

func NewDataset(data ...map[string]interface{}) *Dataset

NewDataset creates a new Dataset adding the appropriate rows.

func (*Dataset) Run Uses

func (set *Dataset) Run(query *Query) ([]map[string]interface{}, error)

Run executes the query against the dataset.

type Filter Uses

type Filter struct {
    Field    string      `json:"field"`
    Operator Operator    `json:"operator"`
    Value    interface{} `json:"value"`
}

Filter represents fields needed to distil a dataset.

type Operator Uses

type Operator struct {
    Code string `json:"code"`
    Type string `json:"type"`
}

Operator represents a filter operator that will be used to distil a dataset.

type Query Uses

type Query struct {
    Filters []Filter
}

Query ...

Package distil imports 6 packages (graph). Updated 2019-06-18. Refresh now. Tools for package owners.