Documentation ¶
Index ¶
- func FromDict(m *skylark.Dict) (map[interface{}]interface{}, error)
- func FromList(l *skylark.List) ([]interface{}, error)
- func FromSet(s *skylark.Set) (map[interface{}]bool, error)
- func FromStringDict(m skylark.StringDict) map[string]interface{}
- func FromTuple(v skylark.Tuple) ([]interface{}, error)
- func FromValue(v skylark.Value) (interface{}, error)
- func MakeDict(d map[interface{}]interface{}) (*skylark.Dict, error)
- func MakeList(v []interface{}) (*skylark.List, error)
- func MakeSet(s map[interface{}]bool) (*skylark.Set, error)
- func MakeSkyFn(name string, gofn interface{}) *skylark.Builtin
- func MakeStringDict(m map[string]interface{}) (skylark.StringDict, error)
- func MakeTuple(v []interface{}) (skylark.Tuple, error)
- func ToValue(v interface{}) (skylark.Value, error)
- type Kwarg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromStringDict ¶
func FromStringDict(m skylark.StringDict) map[string]interface{}
FromStringDict makes a map[string]interface{} from the given arg. Any unconvertible values are ignored.
func MakeDict ¶
MakeDict makes a Dict from the given map. The acceptable keys and values are the same as ToValue.
func MakeList ¶
MakeList makes a list from the given values. The acceptable values are the same as ToValue.
func MakeSkyFn ¶
MakeSkyFn creates a wrapper around the given function that can be called from a skylark script. Argument support is the same as ToValue. If the last value the function returns is an error, it will cause an error to be returned from the skylark function. If there are no other errors, the function will return None. If there's exactly one other value, the function will return the skylark equivalent of that value. If there is more than one return value, they'll be returned as a tuple. MakeSkyFn will panic if you pass it something other than a function.
func MakeStringDict ¶
func MakeStringDict(m map[string]interface{}) (skylark.StringDict, error)
MakeStringDict makes a StringDict from the given arg. The types supported are the same as ToValue.
func MakeTuple ¶
MakeTuple makes a tuple from the given values. The acceptable values are the same as ToValue.
func ToValue ¶
ToValue attempts to convert the given value to a skylark.Value. It supports all int, uint, and float numeric types, strings, and bools. Any skylark.Value is passed through as-is. A []interface{} is converted with MakeList, map[interface{}]interface{} is converted with MakeDict, and map[interface{}]bool is converted with MakeSet.