Documentation ¶
Index ¶
- Constants
- type Module
- func (m *Module) AddAllMethods(sd skylark.StringDict) skylark.StringDict
- func (m *Module) GetBody(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, ...) (skylark.Value, error)
- func (m *Module) GetConfig(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, ...) (skylark.Value, error)
- func (m *Module) GetSecret(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, ...) (skylark.Value, error)
- func (m *Module) SetMeta(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, ...) (skylark.Value, error)
- func (m *Module) Struct() *skylarkstruct.Struct
- type SkylarkEntryWriter
Constants ¶
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 (*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 ¶
SkylarkEntryWriter creates a skylark.Value as an EntryWriter
func NewSkylarkEntryWriter ¶
func NewSkylarkEntryWriter(st *dataset.Structure) (*SkylarkEntryWriter, error)
NewSkylarkEntryWriter returns a new SkylarkEntryWriter
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