gqlutil

package
v0.0.0-...-9d3c4bc Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndRegisterTable

func CreateAndRegisterTable(ctx context.Context, tableType TableType, sess *gql.Session, name string, nRows int, picker func(row int) gql.Value) func() error

CreateAndRegisterTable will create a new table of the specified type from the data returned by the picker function and register that table in the supplied session as a global variable.

func NewDiskTableFromMemory

func NewDiskTableFromMemory(ctx context.Context, name string, nRows int, picker func(row int) gql.Value) (gql.Table, func() error)

NewDiskTableFromMemory is like NewInMemoryTableFromMemory except that it writes the table create to disk rather than keeping it in memory.

func NewInMemoryTableFromMemory

func NewInMemoryTableFromMemory(name string, nRows int, picker func(row int) gql.Value) gql.Table

NewInMemoryTableFromMemory creates an instance of an in-memory gql.NewSimpleTableFromMemory using the data provided via the picker function to populate the table. It is only suited for data sets that are small enough to fit in memory twice, once for the original data set and a second copy for the table created here.

func RowAsValue

func RowAsValue(row []gql.StructField) gql.Value

RowAsValue returns the supplied row represented as slice of StructFields into a gql.Value.

Types

type TableType

type TableType int

TableType represents the types of table that can be created by CreateAndRegisterTable

const (
	// BTSVDiskTable represents a btsv (binary tsv) on disk table.
	BTSVDiskTable TableType = iota
	// SimpleRAMTable represents a simple implementation of an in-RAM table.
	SimpleRAMTable
)

Jump to

Keyboard shortcuts

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