Documentation ¶
Index ¶
- func FindStructMembers(topLevelTypes []*types.Type) ([]*types.Type, error)
- func LoadStarlarkGenTypes(pkg string) (*types.Package, []*types.Type, error)
- func OpenOutputFile(outDir string) (w io.Writer, path string, err error)
- func WritePreamble(pkg *types.Package, w io.Writer) error
- func WriteStarlarkAPIObjectFunction(t *types.Type, pkg *types.Package, w io.Writer) error
- func WriteStarlarkRegistrationFunc(types []*types.Type, pkg *types.Package, w io.Writer) error
- func WriteStarlarkStructFunction(t *types.Type, pkg *types.Package, w io.Writer) error
- func WriteStarlarkStructListFunction(t *types.Type, pkg *types.Package, w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindStructMembers ¶
Find all the member types that need custom unpackers.
func LoadStarlarkGenTypes ¶
Find all top-level types with the tilt:starlark-gen=true tag.
func OpenOutputFile ¶
Opens the output file.
func WritePreamble ¶
Writes the package header.
func WriteStarlarkAPIObjectFunction ¶
Given a gengo Type, create a starlark function that reads that type.
func WriteStarlarkRegistrationFunc ¶
Writes a function that registers all the starlark methods.
func WriteStarlarkStructFunction ¶
Given a member struct type, we need to 3 pieces: 1) A starlark type so that this struct can be passed around. 2) An Unpack() function so that this struct can be read from a dict. 3) A built-in function that constructs the object natively.
func WriteStarlarkStructListFunction ¶
Given a member list struct type, we need to 2 pieces: 1) A starlark type so that this struct can be passed around. 2) An Unpack() function so that this struct can be read from a list.
Types ¶
This section is empty.