qri

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "qri.sky"

ModuleName defines the expected name for this module when used in skylark's load() function, eg: load('qri.sky', '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 skylark module

func NewModule

func NewModule(ds *dataset.Dataset, secrets map[string]interface{}, infile cafs.File) *Module

NewModule creates a new qri module instance

func (*Module) AddAllMethods

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

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

func (*Module) GetBody

func (m *Module) 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 (*Module) GetConfig

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

GetConfig returns transformation configuration details TODO - supplying a string argument to qri.get_config('foo') should return the single config value instead of the whole map

func (*Module) GetSecret

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

GetSecret fetches a dict of secrets TODO - supplying a string argument to qri.get_secret('foo') should return the single secret value instead of the whole map

func (*Module) SetMeta

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

SetMeta sets a dataset meta field

func (*Module) Struct

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

Struct returns this module's methods as a skylark Struct

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