ds

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package ds exposes the qri dataset document model into skylark

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

Dataset is a qri dataset skylark type

func NewDataset

func NewDataset(ds *dataset.Dataset, infile cafs.File) *Dataset

NewDataset creates a dataset object

func (*Dataset) Dataset

func (d *Dataset) Dataset() *dataset.Dataset

Dataset returns the underlying dataset

func (*Dataset) GetBody

func (d *Dataset) GetBody(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

GetBody returns the body of the dataset we're transforming

func (*Dataset) Infile

func (d *Dataset) Infile() cafs.File

Infile gives access to the private infile

func (*Dataset) Methods

func (d *Dataset) Methods() *skylarkstruct.Struct

Methods exposes dataset methods as skylark values

func (*Dataset) SetBody

func (d *Dataset) SetBody(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

SetBody assigns the dataset body

func (*Dataset) SetMeta

func (d *Dataset) SetMeta(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

SetMeta sets a dataset meta field

func (*Dataset) SetSchema

func (d *Dataset) SetSchema(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

SetSchema sets the dataset schema field

type EntryReader

type EntryReader struct {
	// contains filtered or unexported fields
}

EntryReader implements the dsio.EntryReader interface for skylark.Iterable's

func NewEntryReader

func NewEntryReader(st *dataset.Structure, iter skylark.Iterable) *EntryReader

NewEntryReader creates a new Entry Reader

func (*EntryReader) ReadEntry

func (r *EntryReader) ReadEntry() (e dsio.Entry, err error)

ReadEntry reads one entry from the reader

func (*EntryReader) Structure

func (r *EntryReader) Structure() *dataset.Structure

Structure gives this reader's structure

type SkylarkEntryWriter

type SkylarkEntryWriter struct {
	IsDict bool
	Struct *dataset.Structure
	Object skylark.Value
}

SkylarkEntryWriter creates a skylark.Value as an EntryWriter

func NewSkylarkEntryWriter

func NewSkylarkEntryWriter(st *dataset.Structure) (*SkylarkEntryWriter, error)

NewSkylarkEntryWriter returns a new SkylarkEntryWriter

func (*SkylarkEntryWriter) Close

func (w *SkylarkEntryWriter) Close() error

Close is a no-op

func (*SkylarkEntryWriter) Structure

func (w *SkylarkEntryWriter) Structure() *dataset.Structure

Structure returns the EntryWriter's dataset structure

func (*SkylarkEntryWriter) Value

func (w *SkylarkEntryWriter) Value() skylark.Value

Value returns the underlying skylark.Value

func (*SkylarkEntryWriter) WriteEntry

func (w *SkylarkEntryWriter) WriteEntry(ent dsio.Entry) error

WriteEntry adds an entry to the underlying skylark.Value

Jump to

Keyboard shortcuts

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