Documentation ¶
Overview ¶
Package internal contains types and utilities that are not part of the public API, and may change without notice. It should be only imported by the custom Starlark modules under starlet/lib folders, and not by the Starlet main package to avoid cyclic import.
Index ¶
Constants ¶
const StarletVersion = "v0.1.0"
StarletVersion should be the current version of Starlet.
Variables ¶
var ( // HereDoc returns un-indented string as here-document. HereDoc = here.Doc // HereDocf returns unindented and formatted string as here-document. Formatting is done as for fmt.Printf(). HereDocf = here.Docf )
Functions ¶
func ExecModuleWithErrorTest ¶
func ExecModuleWithErrorTest(t *testing.T, name string, loader ModuleLoadFunc, script string, wantErr string, predecl starlark.StringDict) (starlark.StringDict, error)
ExecModuleWithErrorTest executes a Starlark script with a module loader and compares the error with the expected error.
func GetBytesMD5 ¶ added in v0.0.10
GetBytesMD5 returns the MD5 hash of the given data as a hex string.
func GetStringMD5 ¶ added in v0.0.10
GetStringMD5 returns the MD5 hash of the given string as a hex string.
Types ¶
type DoNotCompare ¶ added in v0.1.2
type DoNotCompare [0]func()
DoNotCompare prevents struct comparisons when embedded. It disallows the use of == and != operators.
type ModuleLoadFunc ¶
type ModuleLoadFunc func() (starlark.StringDict, error)
ModuleLoadFunc is a function that loads a Starlark module and returns the module's string dict.
type ThreadLoadFunc ¶
ThreadLoadFunc is a function that loads a Starlark module by name, usually used by the Starlark thread.
func NewAssertLoader ¶
func NewAssertLoader(moduleName string, loader ModuleLoadFunc) ThreadLoadFunc
NewAssertLoader creates a Starlark thread loader that loads a module by name or asserts.star for testing.