qri

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

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(repo repo.Repo) *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

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

StarlarkEntryWriter creates a starlark.Value as an EntryWriter

func NewStarlarkEntryWriter

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

NewStarlarkEntryWriter returns a new StarlarkEntryWriter

func (*StarlarkEntryWriter) Close

func (w *StarlarkEntryWriter) Close() error

Close is a no-op

func (*StarlarkEntryWriter) Structure

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

Structure returns the EntryWriter's dataset structure

func (*StarlarkEntryWriter) Value

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

Value returns the underlying starlark.Value

func (*StarlarkEntryWriter) WriteEntry

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