Versions in this module Expand all Collapse all v0 v0.2.1 Oct 23, 2023 v0.2.0 Oct 23, 2023 Changes in this version + const DebugLevel + const ErrorLevel + const InfoLevel + const WarnLevel + func Errorf(err error, format string, args ...interface{}) error + func Errors(msg string, errs []error) error + func Start(cfg Config, patterns ...string) error + type CommandFilter string + func FilterByCommand(command string) CommandFilter + func (cmd CommandFilter) Filter(ng FilterEngine) error + func (cmd CommandFilter) FilterAll(ng FilterEngine) error + func (cmd CommandFilter) Include(ds Directives) bool + type Comment struct + Comment *ast.CommentGroup + Directives []Directive + Doc *ast.CommentGroup + func (c Comment) Text() string + type Config struct + BuildTags []string + CleanOnly bool + EnabledPlugins map[string]bool + GenerateFileName func(GenerateFileNameInput) string + GoimportsArgs []string + LogHandler LogHandler + LogLevel LogLevel + Namespace string + Plugins []Plugin + func (c *Config) EnablePlugin(names ...string) + func (c *Config) RegisterPlugin(plugins ...Plugin) + type DefaultQualifier struct + func (q DefaultQualifier) Qualify(pkg *types.Package) string + type Directive struct + Arg string + Cmd string + Item Positioner + Raw string + func ParseDirective(line string) (result Directive, _ error) + func ParseDirectiveFromBody(body []byte) (directives, inlineDirective []Directive, err error) + func ParseDirectiveFromFile(filename string) (directives, inlineDirective []Directive, err error) + func (d Directive) GetArgs() ([]string, error) + func (d Directive) IsPackageLevel() bool + func (d Directive) String() string + type Directives []Directive + func (ds Directives) FilterBy(prefix string) Directives + func (ds Directives) Get(cmd string) (Directive, bool) + func (ds Directives) GetArg(cmd string) string + type Engine interface + GenerateEachPackage func(func(Engine, *packages.Package, Printer) error) error + GenerateFile func(pkgName, filePath string) (Printer, error) + GeneratePackage func(pkg *packages.Package, fileName string) (Printer, error) + GeneratingPackages func() []*GeneratingPackage + GetBuiltinType func(name string) types.Type + GetComment func(Positioner) Comment + GetDirectives func(Positioner) Directives + GetDirectivesByPackage func(*packages.Package) Directives + GetIdent func(Positioner) *ast.Ident + GetObject func(Positioner) types.Object + GetObjectByName func(pkgPath, name string) types.Object + GetObjectsByPackage func(*packages.Package) []types.Object + GetObjectsByScope func(*types.Scope) []types.Object + GetPackage func(Positioner) *packages.Package + GetPackageByPath func(string) *packages.Package + LogDebugNode func(node ast.Node) error + type FilterEngine interface + IncludePackage func(pkgPath string) + ParsePackage func(pkgPath string) + ParsePackages func(patterns ...string) + ParsingPackages func() []*FilteringPackage + type Filterer interface + Filter func(FilterEngine) error + type FilteringPackage struct + Directives Directives + Imports map[string]*packages.Package + InlineDirectives Directives + PkgPath string + func (p *FilteringPackage) Include() + type GenerateFileNameInput struct + PluginName string + type GeneratingPackage struct + func (g *GeneratingPackage) GetDirectives() []Directive + func (g *GeneratingPackage) GetObjects() []types.Object + func (g *GeneratingPackage) GetPrinter() Printer + type LogAttr = log.Attr + type LogHandler = log.Handler + type LogLevel = log.Level + type Logger = log.Logger + type Plugin interface + Filter func(FilterEngine) error + Generate func(Engine) error + Name func() string + type Positioner interface + Pos func() token.Pos + type Printer interface + Bytes func() []byte + FilePath func() string + Import func(name, path string) + Qualifier func(pkg *types.Package) string + TypeString func(types.Type) string + type Qualifier interface + Qualify func(*types.Package) string