codegen

package
v0.0.0-...-1ee5f4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindStructMembers

func FindStructMembers(topLevelTypes []*types.Type) ([]*types.Type, error)

Find all the member types that need custom unpackers.

func LoadStarlarkGenTypes

func LoadStarlarkGenTypes(pkg string) (*types.Package, []*types.Type, error)

Find all top-level types with the tilt:starlark-gen=true tag.

func OpenOutputFile

func OpenOutputFile(outDir string) (io.Writer, error)

Opens the output file.

func WritePreamble

func WritePreamble(pkg *types.Package, w io.Writer) error

Writes the package header.

func WriteStarlarkFunction

func WriteStarlarkFunction(t *types.Type, pkg *types.Package, w io.Writer) error

Given a gengo Type, create a starlark function that reads that type.

func WriteStarlarkMemberClass

func WriteStarlarkMemberClass(t *types.Type, pkg *types.Package, w io.Writer) error

Given a gengo member Type, generate the class for that type. This needs to appear before any functions that use the class, due to how Python type resolution works.

func WriteStarlarkMemberFunction

func WriteStarlarkMemberFunction(t *types.Type, pkg *types.Package, w io.Writer) error

Given a gengo member Type, create a starlark function that constructs that type and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL