Documentation ¶
Overview ¶
Package skytf implements dataset transformations using the skylark programming dialect For more info on skylark check github.com/google/skylark
Index ¶
Constants ¶
const Version = "0.0.2"
Version is the current version of this skytf, this version number will be written with each transformation exectution
Variables ¶
var ErrNotDefined = fmt.Errorf("not defined")
ErrNotDefined is for when a skylark value is not defined or does not exist
Functions ¶
func DefaultExecOpts ¶
func DefaultExecOpts(o *ExecOpts)
DefaultExecOpts applies default options to an ExecOpts pointer
func Error ¶
func Error(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)
Error halts program execution with an error
func ExecFile ¶
func ExecFile(ds *dataset.Dataset, filename string, infile cafs.File, opts ...func(o *ExecOpts)) (dsio.EntryReader, error)
ExecFile executes a transformation against a skylark file located at filepath, giving back an EntryReader of resulting data ExecFile modifies the given dataset pointer. At bare minimum it will set transformation details, but skylark scripts can modify many parts of the dataset pointer, including meta, structure, and transform
Types ¶
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, data 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 ExecOpts ¶
type ExecOpts struct { AllowFloat bool // allow floating-point numbers AllowSet bool // allow set data type AllowLambda bool // allow lambda expressions AllowNestedDef bool // allow nested def statements Secrets map[string]interface{} // passed-in secrets (eg: API keys) Globals skylark.StringDict }
ExecOpts defines options for exection