Documentation ¶
Index ¶
- Variables
- func HashModule() starlark.Value
- func JsonModule() starlark.Value
- func NewSkyProtoMessage(msg proto.Message) *skyProtoMessage
- func ToProtoMessage(val starlark.Value) (proto.Message, bool)
- func UrlModule() starlark.Value
- func YamlModule() starlark.Value
- type Module
- type ProtoModule
- func (mod *ProtoModule) Attr(name string) (starlark.Value, error)
- func (mod *ProtoModule) AttrNames() []string
- func (mod *ProtoModule) Freeze()
- func (mod *ProtoModule) Hash() (uint32, error)
- func (mod *ProtoModule) String() string
- func (mod *ProtoModule) Truth() starlark.Bool
- func (mod *ProtoModule) Type() string
- type ProtoRegistry
- type TestContext
- func (t *TestContext) AssertBinaryImpl(op syntax.Token) ...
- func (t *TestContext) AssertFails(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (t *TestContext) Attr(name string) (starlark.Value, error)
- func (t *TestContext) AttrNames() []string
- func (t *TestContext) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
- func (t *TestContext) Freeze()
- func (t *TestContext) Hash() (uint32, error)
- func (t *TestContext) Name() string
- func (t *TestContext) String() string
- func (t *TestContext) Truth() starlark.Bool
- func (t *TestContext) Type() string
Constants ¶
This section is empty.
Variables ¶
var Fail = starlark.NewBuiltin("fail", failImpl)
Functions ¶
func HashModule ¶
func JsonModule ¶
JsonModule returns a Starlark module for JSON helpers.
func NewSkyProtoMessage ¶
func YamlModule ¶
YamlModule returns a Starlark module for YAML helpers.
Types ¶
type Module ¶
type Module struct { Name string Attrs starlark.StringDict }
A Starlark module, for namespacing of built-in functions.
type ProtoModule ¶
type ProtoModule struct { Registry ProtoRegistry // contains filtered or unexported fields }
func NewProtoModule ¶
func NewProtoModule(registry ProtoRegistry) *ProtoModule
func (*ProtoModule) AttrNames ¶
func (mod *ProtoModule) AttrNames() []string
func (*ProtoModule) Freeze ¶
func (mod *ProtoModule) Freeze()
func (*ProtoModule) Hash ¶
func (mod *ProtoModule) Hash() (uint32, error)
func (*ProtoModule) String ¶
func (mod *ProtoModule) String() string
func (*ProtoModule) Truth ¶
func (mod *ProtoModule) Truth() starlark.Bool
func (*ProtoModule) Type ¶
func (mod *ProtoModule) Type() string
type ProtoRegistry ¶
type ProtoRegistry interface { // UNSTABLE lookup from full protobuf message name to a Go type of the // generated message struct. UnstableProtoMessageType(name string) (reflect.Type, error) // UNSTABLE lookup from go-protobuf enum name to the name->value map. UnstableEnumValueMap(name string) map[string]int32 }
UNSTABLE extension point for configuring how protobuf messages are loaded.
This will be stabilized after the go-protobuf v2 API has reached GA.
type TestContext ¶
type TestContext struct { Attrs starlark.StringDict Failures []error }
TestContext is keeps track of whether there is a failure during a test execution
func AssertModule ¶
func AssertModule() *TestContext
AssertModule contains assertion functions. The *TestContext returned can be used to track assertion failures. assert.* functions from this module will mutate the *TestContext. After execution is complete, TestContext.Failures will be non-empty if any of the assertions failed, and also contain details about the failures.
func (*TestContext) AssertBinaryImpl ¶
func (t *TestContext) AssertBinaryImpl(op syntax.Token) func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
AssertBinaryImpl returns a function that implements comparing binary values in an assertion (i.e. assert_eq(1, 2))
func (*TestContext) AssertFails ¶
func (*TestContext) AttrNames ¶
func (t *TestContext) AttrNames() []string
func (*TestContext) CallInternal ¶
func (t *TestContext) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
CallInternal is the implementation for assert(...)
func (*TestContext) Freeze ¶
func (t *TestContext) Freeze()
func (*TestContext) Hash ¶
func (t *TestContext) Hash() (uint32, error)
func (*TestContext) Name ¶
func (t *TestContext) Name() string
func (*TestContext) String ¶
func (t *TestContext) String() string
func (*TestContext) Truth ¶
func (t *TestContext) Truth() starlark.Bool
func (*TestContext) Type ¶
func (t *TestContext) Type() string