Documentation ¶
Overview ¶
Package core provides facilities for low-level integration with Starlark.
Index ¶
- func BoolArg(kwargs []starlark.Tuple, keyToFind string) (bool, error)
- func CheckArgNames(kwargs []starlark.Tuple, validKeys map[string]struct{}) error
- func Int64Arg(kwargs []starlark.Tuple, keyToFind string) (int64, error)
- type GoValue
- type GoValueOpts
- type GoValueToStarlarkValueConversion
- type StarlarkFunc
- type StarlarkNoop
- type StarlarkStruct
- func (s *StarlarkStruct) Attr(name string) (starlark.Value, error)
- func (s *StarlarkStruct) AttrNames() []string
- func (s *StarlarkStruct) Freeze()
- func (s *StarlarkStruct) Get(key starlark.Value) (val starlark.Value, found bool, err error)
- func (s *StarlarkStruct) Hash() (uint32, error)
- func (s *StarlarkStruct) Items() (items []starlark.Tuple)
- func (s *StarlarkStruct) Iterate() starlark.Iterator
- func (s *StarlarkStruct) Len() int
- func (s *StarlarkStruct) String() string
- func (s *StarlarkStruct) Truth() starlark.Bool
- func (s *StarlarkStruct) Type() string
- type StarlarkStructIterator
- type StarlarkValue
- type StarlarkValueToGoValueConversion
- type UnconvertableStarlarkValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckArgNames ¶ added in v0.48.0
Types ¶
type GoValue ¶
type GoValue struct {
// contains filtered or unexported fields
}
func NewGoValue ¶
func NewGoValue(val interface{}) GoValue
func NewGoValueWithOpts ¶ added in v0.48.0
func NewGoValueWithOpts(val interface{}, opts GoValueOpts) GoValue
func (GoValue) AsStarlarkValue ¶
type GoValueOpts ¶ added in v0.48.0
type StarlarkFunc ¶
type StarlarkFunc func(thread *starlark.Thread, f *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
func ErrDescWrapper ¶ added in v0.25.0
func ErrDescWrapper(desc string, wrappedFunc StarlarkFunc) StarlarkFunc
func ErrWrapper ¶
func ErrWrapper(wrappedFunc StarlarkFunc) StarlarkFunc
type StarlarkNoop ¶
type StarlarkNoop struct{}
func (*StarlarkNoop) Freeze ¶
func (s *StarlarkNoop) Freeze()
func (*StarlarkNoop) Hash ¶
func (s *StarlarkNoop) Hash() (uint32, error)
func (*StarlarkNoop) String ¶
func (s *StarlarkNoop) String() string
func (*StarlarkNoop) Truth ¶
func (s *StarlarkNoop) Truth() starlark.Bool
func (*StarlarkNoop) Type ¶
func (s *StarlarkNoop) Type() string
type StarlarkStruct ¶
type StarlarkStruct struct {
// contains filtered or unexported fields
}
func NewStarlarkStruct ¶ added in v0.48.0
func NewStarlarkStruct(goStringKeyToStarlarkValue *orderedmap.Map) *StarlarkStruct
func (*StarlarkStruct) Attr ¶
func (s *StarlarkStruct) Attr(name string) (starlark.Value, error)
returns (nil, nil) if attribute not present
func (*StarlarkStruct) AttrNames ¶
func (s *StarlarkStruct) AttrNames() []string
callers must not modify the result.
func (*StarlarkStruct) Freeze ¶
func (s *StarlarkStruct) Freeze()
func (*StarlarkStruct) Hash ¶
func (s *StarlarkStruct) Hash() (uint32, error)
func (*StarlarkStruct) Items ¶ added in v0.48.0
func (s *StarlarkStruct) Items() (items []starlark.Tuple)
func (*StarlarkStruct) Iterate ¶ added in v0.48.0
func (s *StarlarkStruct) Iterate() starlark.Iterator
func (*StarlarkStruct) Len ¶ added in v0.48.0
func (s *StarlarkStruct) Len() int
func (*StarlarkStruct) String ¶
func (s *StarlarkStruct) String() string
func (*StarlarkStruct) Truth ¶
func (s *StarlarkStruct) Truth() starlark.Bool
func (*StarlarkStruct) Type ¶
func (s *StarlarkStruct) Type() string
type StarlarkStructIterator ¶ added in v0.48.0
type StarlarkStructIterator struct {
// contains filtered or unexported fields
}
func (*StarlarkStructIterator) Done ¶ added in v0.48.0
func (s *StarlarkStructIterator) Done()
type StarlarkValue ¶
type StarlarkValue struct {
// contains filtered or unexported fields
}
func NewStarlarkValue ¶
func NewStarlarkValue(val starlark.Value) StarlarkValue
func (StarlarkValue) AsBool ¶
func (e StarlarkValue) AsBool() (bool, error)
func (StarlarkValue) AsFloat64 ¶ added in v0.48.0
func (e StarlarkValue) AsFloat64() (float64, error)
AsFloat64 converts a Starlark number (either int or float) to the corresponding Go double-precision float.
func (StarlarkValue) AsGoValue ¶ added in v0.48.0
func (e StarlarkValue) AsGoValue() (interface{}, error)
func (StarlarkValue) AsInt64 ¶
func (e StarlarkValue) AsInt64() (int64, error)
func (StarlarkValue) AsString ¶
func (e StarlarkValue) AsString() (string, error)
type StarlarkValueToGoValueConversion ¶
type StarlarkValueToGoValueConversion interface {
AsGoValue() (interface{}, error)
}
type UnconvertableStarlarkValue ¶ added in v0.48.0
type UnconvertableStarlarkValue interface {
ConversionHint() string
}
Click to show internal directories.
Click to hide internal directories.