qri

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ModuleName = "qri.star"

ModuleName defines the expected name for this module when used in starlark's load() function, eg: load('qri.star', 'qri')

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module encapsulates state for a qri starlark module

func NewModule

func NewModule(node *p2p.QriNode) *Module

NewModule creates a new qri module instance

func (*Module) AddAllMethods

func (m *Module) AddAllMethods(sd starlark.StringDict) starlark.StringDict

AddAllMethods augments a starlark.StringDict with all qri builtins. Should really only be used during "transform" step

func (*Module) ListDatasets

func (m *Module) ListDatasets(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

ListDatasets shows current local datasets

func (*Module) Namespace

func (m *Module) Namespace() starlark.StringDict

Namespace produces this module's exported namespace

func (*Module) Struct

func (m *Module) Struct() *starlarkstruct.Struct

Struct returns this module's methods as a starlark Struct

type StarlarkEntryWriter added in v0.2.0

type StarlarkEntryWriter struct {
	IsDict bool
	Struct *dataset.Structure
	Object starlark.Value
}

StarlarkEntryWriter creates a starlark.Value as an EntryWriter

func NewStarlarkEntryWriter added in v0.2.0

func NewStarlarkEntryWriter(st *dataset.Structure) (*StarlarkEntryWriter, error)

NewStarlarkEntryWriter returns a new StarlarkEntryWriter

func (*StarlarkEntryWriter) Close added in v0.2.0

func (w *StarlarkEntryWriter) Close() error

Close is a no-op

func (*StarlarkEntryWriter) Structure added in v0.2.0

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

Structure returns the EntryWriter's dataset structure

func (*StarlarkEntryWriter) Value added in v0.2.0

func (w *StarlarkEntryWriter) Value() starlark.Value

Value returns the underlying starlark.Value

func (*StarlarkEntryWriter) WriteEntry added in v0.2.0

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

WriteEntry adds an entry to the underlying starlark.Value

Jump to

Keyboard shortcuts

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