Versions in this module Expand all Collapse all v0 v0.1.4 Jun 1, 2024 v0.1.3 May 5, 2024 v0.1.2 May 1, 2024 v0.1.1 May 1, 2024 v0.1.0 Apr 14, 2024 v0.0.10 Apr 14, 2024 v0.0.9 Mar 20, 2024 v0.0.8 Mar 19, 2024 Changes in this version type Config + IsValid bool v0.0.7 Mar 1, 2024 v0.0.6 Feb 21, 2024 v0.0.5 Feb 18, 2024 v0.0.4 Feb 5, 2024 v0.0.3 Jan 25, 2024 v0.0.2 Jan 17, 2024 Changes in this version + var AllowedEnumTypes = map[string]bool + var DescMethodTmpl = template.Must(template.New("DescMethod").Parse(...)) + var GQLMethodsTmpl = template.Must(template.New("GQLMethods").Parse(...)) + var HasFlagMethodTmpl = template.Must(template.New("HasFlagMethod").Parse(...)) + var Int64MethodTmpl = template.Must(template.New("Int64Method").Parse(...)) + var IsValidMethodMapTmpl = template.Must(template.New("IsValidMethodMap").Parse(...)) + var JSONMethodsTmpl = template.Must(template.New("JSONMethods").Parse(...)) + var NConstantTmpl = template.Must(template.New("StringNConstant").Parse(...)) + var ScanMethodTmpl = template.Must(template.New("ScanMethod").Parse(...)) + var SetFlagMethodTmpl = template.Must(template.New("SetFlagMethod").Parse(...)) + var SetInt64MethodTmpl = template.Must(template.New("SetInt64Method").Parse(...)) + var SetStringMethodBitFlagTmpl = template.Must(template.New("SetStringMethodBitFlag").Parse(...)) + var SetStringMethodTmpl = template.Must(template.New("SetStringMethod").Parse(...)) + var SetStringOrMethodBitFlagTmpl = template.Must(template.New("SetStringOrMethodBitFlag").Parse(...)) + var StringMethodBitFlagTmpl = template.Must(template.New("StringMethodBitFlag").Parse(...)) + var StringMethodMapTmpl = template.Must(template.New("StringMethodMap").Parse(...)) + var TextMethodsTmpl = template.Must(template.New("TextMethods").Parse(...)) + var ValueMethodTmpl = template.Must(template.New("ValueMethod").Parse(...)) + var ValuesGlobalTmpl = template.Must(template.New("ValuesGlobal").Parse(...)) + var ValuesMethodTmpl = template.Must(template.New("ValuesMethod").Parse(...)) + var YAMLMethodsTmpl = template.Must(template.New("YAMLMethods").Parse(...)) + func Generate(cfg *Config) error + func GeneratePkgs(cfg *Config, pkgs []*packages.Package) error + func PackageModes() packages.LoadMode + func ParsePackages(cfg *Config) ([]*packages.Package, error) + type ByValue []Value + func (b ByValue) Len() int + func (b ByValue) Less(i, j int) bool + func (b ByValue) Swap(i, j int) + type Config struct + AcceptLower bool + AddPrefix string + Dir string + Extend bool + GQL bool + JSON bool + LineComment bool + Output string + SQL bool + Text bool + Transform string + TrimPrefix string + YAML bool + type Generator struct + Buf bytes.Buffer + Config *Config + Pkg *packages.Package + Pkgs []*packages.Package + Types []*Type + func NewGenerator(config *Config, pkgs []*packages.Package) *Generator + func (g *Generator) AddValueAndScanMethod(typ *Type) + func (g *Generator) BuildBasicMethods(values []Value, typ *Type) + func (g *Generator) BuildBitFlagMethods(runs []Value, typ *Type) + func (g *Generator) BuildGQLMethods(runs []Value, typ *Type) + func (g *Generator) BuildJSONMethods(runs []Value, typ *Type) + func (g *Generator) BuildNoOpOrderChangeDetect(values []Value, typ *Type) + func (g *Generator) BuildString(values []Value, typ *Type) + func (g *Generator) BuildTextMethods(runs []Value, typ *Type) + func (g *Generator) BuildYAMLMethods(runs []Value, typ *Type) + func (g *Generator) ExecTmpl(t *template.Template, typ *Type) + func (g *Generator) FindEnumTypes() error + func (g *Generator) GenDecl(node ast.Node, file *ast.File, typ *Type) ([]Value, bool, error) + func (g *Generator) Generate() (bool, error) + func (g *Generator) InspectForType(n ast.Node) (bool, error) + func (g *Generator) PrefixValueNames(values []Value, c *Config) + func (g *Generator) PrintDescMap(values []Value, typ *Type) + func (g *Generator) PrintHeader() + func (g *Generator) PrintValueMap(values []Value, typ *Type) + func (g *Generator) Printf(format string, args ...any) + func (g *Generator) TransformValueNames(values []Value, c *Config) error + func (g *Generator) TrimValueNames(values []Value, c *Config) + func (g *Generator) Write() error + type Type struct + Config *Config + Extends string + IsBitFlag bool + MaxValueP1 int64 + Name string + Type *ast.TypeSpec + type Value struct + Desc string + Name string + OriginalName string + Signed bool + Str string + Value int64 + func SortValues(values []Value) []Value + func (v *Value) String() string