Documentation ¶
Index ¶
- func Bind[T any](thread *starlark.Thread, dst *T, unpacker UnpackerInto[T]) starlark.Unpacker
- type Canonicalizer
- type UnpackerInto
- func Canonicalize(base Canonicalizer) UnpackerInto[starlark.Value]
- func Dict[TKey comparable, TValue any](keyUnpacker UnpackerInto[TKey], valueUnpacker UnpackerInto[TValue]) UnpackerInto[map[TKey]TValue]
- func IfNonEmptyString[T any](base UnpackerInto[T]) UnpackerInto[T]
- func IfNotNone[T any](base UnpackerInto[T]) UnpackerInto[T]
- func Int[T constraints.Integer]() UnpackerInto[T]
- func List[T any](base UnpackerInto[T]) UnpackerInto[[]T]
- func Or[T any](unpackers []UnpackerInto[T]) UnpackerInto[T]
- func PathParser(pathFormat path.Format) UnpackerInto[path.Parser]
- func Pointer[T any](base UnpackerInto[T]) UnpackerInto[*T]
- func Singleton[T any](base UnpackerInto[T]) UnpackerInto[[]T]
- func Stringer[T fmt.Stringer](base UnpackerInto[T]) UnpackerInto[string]
- func Type[T starlark.Value](name string) UnpackerInto[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Canonicalizer ¶
type UnpackerInto ¶
type UnpackerInto[T any] interface { Canonicalizer UnpackInto(thread *starlark.Thread, v starlark.Value, dst *T) error }
var Any UnpackerInto[starlark.Value] = anyUnpackerInto{}
var ApparentLabel UnpackerInto[label.ApparentLabel] = apparentLabelUnpackerInto{}
var ApparentRepo UnpackerInto[label.ApparentRepo] = apparentRepoUnpackerInto{}
var Bool UnpackerInto[bool] = boolUnpackerInto{}
var Module UnpackerInto[label.Module] = moduleUnpackerInto{}
var ModuleVersion UnpackerInto[label.ModuleVersion] = moduleVersionUnpackerInto{}
var StarlarkIdentifier UnpackerInto[label.StarlarkIdentifier] = starlarkIdentifierUnpackerInto{}
var String UnpackerInto[string] = stringUnpackerInto{}
var TargetName UnpackerInto[label.TargetName] = targetNameUnpackerInto{}
var URL UnpackerInto[*url.URL] = urlUnpackerInto{}
func Canonicalize ¶
func Canonicalize(base Canonicalizer) UnpackerInto[starlark.Value]
func Dict ¶
func Dict[TKey comparable, TValue any](keyUnpacker UnpackerInto[TKey], valueUnpacker UnpackerInto[TValue]) UnpackerInto[map[TKey]TValue]
func IfNonEmptyString ¶
func IfNonEmptyString[T any](base UnpackerInto[T]) UnpackerInto[T]
IfNonEmptyString is a decorator for UnpackerInto that only calls into the underlying unpacker if the value is a non-empty string. This can be of use if the default value of an argument is a string, and the empty string is used to denote that a value is unset.
func IfNotNone ¶
func IfNotNone[T any](base UnpackerInto[T]) UnpackerInto[T]
IfNotNone is a decorator for UnpackerInto that only calls into the underlying unpacker if the value is not None. This can be of use if None is used to denote that a value is unset.
func Int ¶
func Int[T constraints.Integer]() UnpackerInto[T]
func List ¶
func List[T any](base UnpackerInto[T]) UnpackerInto[[]T]
func Or ¶
func Or[T any](unpackers []UnpackerInto[T]) UnpackerInto[T]
func PathParser ¶
func PathParser(pathFormat path.Format) UnpackerInto[path.Parser]
func Pointer ¶
func Pointer[T any](base UnpackerInto[T]) UnpackerInto[*T]
func Singleton ¶
func Singleton[T any](base UnpackerInto[T]) UnpackerInto[[]T]
func Stringer ¶
func Stringer[T fmt.Stringer](base UnpackerInto[T]) UnpackerInto[string]
Stringer calls String() on the unpacked value and preserves that instead. This is useful if labels, URLs, etc. need to be captured in string form only.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.