Documentation ¶
Index ¶
- func CreateAndRegisterTable(ctx context.Context, tableType TableType, sess *gql.Session, name string, ...) func() error
- func NewDiskTableFromMemory(ctx context.Context, name string, nRows int, picker func(row int) gql.Value) (gql.Table, func() error)
- func NewInMemoryTableFromMemory(name string, nRows int, picker func(row int) gql.Value) gql.Table
- func RowAsValue(row []gql.StructField) gql.Value
- type TableType
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 ¶
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.