Documentation
¶
Index ¶
- Variables
- func AddPackages(packages map[string]map[string]starlark.Value)
- func Require(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (v starlark.Value, err error)
- func RunScript(file string) (err error)
- func ValidateArgs(types []starlark.Value, args starlark.Tuple) (values []interface{}, err error)
- type ByteArray
- type Channel
- type Error
- type Function
- func (f Function) Builtin() *starlark.Builtin
- func (f Function) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (v starlark.Value, err error)
- func (f Function) Freeze()
- func (f Function) Hash() (uint32, error)
- func (f Function) Name() string
- func (f Function) String() string
- func (f Function) Truth() starlark.Bool
- func (f Function) Type() string
- type Interface
- type Method
- type MethodCall
- type Struct
- func (s Struct) Attr(name string) (v starlark.Value, err error)
- func (s Struct) AttrNames() []string
- func (s Struct) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
- func (s Struct) Freeze()
- func (s Struct) Hash() (uint32, error)
- func (s Struct) Name() string
- func (s Struct) String() string
- func (s Struct) Truth() starlark.Bool
- func (s Struct) Type() string
- type ValueSetter
Constants ¶
This section is empty.
Variables ¶
View Source
var Star = map[string]starlark.Value{ "bytes_to_string": starlark.NewBuiltin("bytes_to_string", func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (v starlark.Value, err error) { out := []starlark.Value{starlark.None, Error{}} if args.Len() != 1 || args.Index(0).Type() != "[]byte" { out[1] = Error{err: errors.New("bytes_to_string takes one argument of type []byte")} } else { out[0] = starlark.String(string(args.Index(0).(ByteArray).b)) } v = starlark.Tuple(out) return }), "chan": starlark.NewBuiltin("chan", func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (v starlark.Value, err error) { out := []starlark.Value{starlark.None, Error{}} if args.Len() != 1 || args.Index(0).Type() != "[]byte" { out[1] = Error{err: errors.New("bytes_to_string takes one argument of type []byte")} } else { out[0] = starlark.String(string(args.Index(0).(ByteArray).b)) } v = starlark.Tuple(out) return }), "go": starlark.NewBuiltin("go", func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (v starlark.Value, err error) { go func() { argsToPass := []starlark.Value(args)[1:] thread := &starlark.Thread{Name: ""} _, err := starlark.Call(thread, args.Index(0), starlark.Tuple(argsToPass), nil) if err != nil { panic(err) } }() v = starlark.None return }), }
Functions ¶
Types ¶
type Function ¶
type Function struct { FunctionName string Args []starlark.Value Returns []starlark.Value Call func([]interface{}) []interface{} }
func (Function) CallInternal ¶
type MethodCall ¶
type MethodCall func(interface{}, []interface{}) []interface{}
type Struct ¶
type Struct struct { TypeName string Value interface{} Initialize func() interface{} Print func(interface{}) string Methods map[string]Method Attributes map[string]starlark.Value }
func (Struct) CallInternal ¶
type ValueSetter ¶
type ValueSetter interface { SetValue(v interface{}) GetValue() (v interface{}) }
Click to show internal directories.
Click to hide internal directories.