Documentation ¶
Index ¶
- Variables
- func ConvertToStringMap(v interface{}) interface{}
- func NewStruct(v interface{}) starlark.Value
- func ToValue(v interface{}) (starlark.Value, error)
- type MethodsWrapper
- type StarlarkStruct
- func (s *StarlarkStruct) Attr(name string) (starlark.Value, error)
- func (s *StarlarkStruct) AttrNames() []string
- func (s *StarlarkStruct) Freeze()
- func (s *StarlarkStruct) Hash() (uint32, error)
- func (s *StarlarkStruct) MarshalJSON() ([]byte, error)
- func (s *StarlarkStruct) SetField(name string, val starlark.Value) error
- func (s *StarlarkStruct) String() string
- func (s *StarlarkStruct) Truth() starlark.Bool
- func (s *StarlarkStruct) Type() string
Constants ¶
This section is empty.
Variables ¶
var StructTags = []string{"starlark"}
Functions ¶
func ConvertToStringMap ¶
func ConvertToStringMap(v interface{}) interface{}
Types ¶
type MethodsWrapper ¶
type StarlarkStruct ¶
type StarlarkStruct struct {
// contains filtered or unexported fields
}
func (*StarlarkStruct) Attr ¶
func (s *StarlarkStruct) Attr(name string) (starlark.Value, error)
Attr returns a starlark value that wraps the method or field with the given name.
func (*StarlarkStruct) AttrNames ¶
func (s *StarlarkStruct) AttrNames() []string
AttrNames returns the list of all fields and methods on this struct.
func (*StarlarkStruct) Freeze ¶
func (s *StarlarkStruct) Freeze()
Freeze causes the value, and all values transitively reachable from it through collections and closures, to be marked as frozen. All subsequent mutations to the data structure through this API will fail dynamically, making the data structure immutable and safe for publishing to other Starlark interpreters running concurrently.
func (*StarlarkStruct) Hash ¶
func (s *StarlarkStruct) Hash() (uint32, error)
Hash returns a function of x such that Equals(x, y) => Hash(x) == Hash(y). Hash may fail if the value's type is not hashable, or if the value contains a non-hashable value.
func (*StarlarkStruct) MarshalJSON ¶
func (s *StarlarkStruct) MarshalJSON() ([]byte, error)
func (*StarlarkStruct) SetField ¶
func (s *StarlarkStruct) SetField(name string, val starlark.Value) error
SetField sets the struct field with the given name with the given value.
func (*StarlarkStruct) String ¶
func (s *StarlarkStruct) String() string
String returns the string representation of the value. Starlark string values are quoted as if by Python's repr.
func (*StarlarkStruct) Truth ¶
func (s *StarlarkStruct) Truth() starlark.Bool
Truth returns the truth value of an object.
func (*StarlarkStruct) Type ¶
func (s *StarlarkStruct) Type() string
Type returns a short string describing the value's type.