Documentation
¶
Overview ¶
Package screenbind generates deterministic, typed Go bindings from *.screen.yaml files.
Index ¶
- Constants
- func Generate(doc *gameui.ScreenDoc, opts Options) ([]byte, error)
- func HasHeader(data []byte) bool
- func NormalizeSource(source string) (string, error)
- func OutputFileName(source string) (string, error)
- func ParseHeader(data []byte) (source string, ok bool)
- func ScreenIdent(source string) (goName, snake string, err error)
- func TopLevelDecls(source string) ([]string, error)
- type Options
Constants ¶
const ( // Header is the first line of every Go file generated by game generate screen. Header = "// Code generated by game generate screen; DO NOT EDIT." // SourcePrefix prefixes the second line of a generated screen file with its slash-separated project-relative screen path. SourcePrefix = "// Source: " )
Variables ¶
This section is empty.
Functions ¶
func NormalizeSource ¶
NormalizeSource cleans a slash-separated screen path and verifies it has a .screen.yaml or .screen.yml suffix.
func OutputFileName ¶
OutputFileName returns the Go file name written for source (for example "hud_screen_gen.go").
func ParseHeader ¶
ParseHeader reports whether data begins with Header followed by a non-empty SourcePrefix line, returning the source path.
func ScreenIdent ¶
ScreenIdent derives the exported Go type prefix (for example "HUD") and snake_case file stem ("hud") from a *.screen.yaml or *.screen.yml path.
func TopLevelDecls ¶
TopLevelDecls returns the package-level Go identifiers generated for source.