Documentation
¶
Overview ¶
Package layerutil provides shared layer discovery and parsing logic for codegen backends (Go, Java, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayerDef ¶
type LayerDef struct {
EnumName string // fully qualified enum name
Values []LayerValue // all enum values
ByName map[string]LayerValue // keyed by lowercase layer name (prefix-stripped)
}
LayerDef holds the discovered layer enum and its parsed values.
func DiscoverLayers ¶
DiscoverLayers scans all files in the plugin request for an enum annotated with option (pbflags.layers) = true. Returns the layer definition, or an error if none is found or multiple are found.
func (*LayerDef) ResolveLayer ¶
func (ld *LayerDef) ResolveLayer(name string) (LayerValue, bool)
ResolveLayer looks up a layer name string (e.g., "entity") against the discovered layer values. Returns the matching LayerValue and true, or false if the name doesn't match any value.
type LayerValue ¶
type LayerValue struct {
Name string // original enum value name, e.g., "LAYER_ENTITY"
Number int32 // enum ordinal
StrippedName string // prefix-stripped name, e.g., "ENTITY"
LayerName string // lowercase layer name for matching, e.g., "entity"
IsGlobal bool // true for ordinal 0, 1, or name containing "GLOBAL"
}
LayerValue represents a single value from the (pbflags.layers) enum.
Click to show internal directories.
Click to hide internal directories.