Documentation
¶
Index ¶
- Constants
- Variables
- func CleanFileName(fName string) string
- func CommentArgs(globalStruct any, comment CommentArgVals) error
- func DocArgsAstFilter(expectedType string, globalStruct any) (func(fSet *token.FileSet, srcFile *os.File, node ast.Node) error, *bool)
- func GenFileExclusionFilter(f fs.FileInfo) bool
- func GetComment(fSet *token.FileSet, srcFile *os.File, doc *ast.CommentGroup, ...) (string, error)
- func GetLongGenericsString(fSet *token.FileSet, srcFile *os.File, ts *ast.TypeSpec) (string, error)
- func GetProgName(args []string) string
- func GetShortGenericsString(fSet *token.FileSet, srcFile *os.File, ts *ast.TypeSpec) (string, error)
- func GetSourceTextFromExpr(fSet *token.FileSet, srcFile *os.File, field ast.Node) (string, error)
- func InlineArgs(globalStruct any, args []string) error
- func IterateOverAST(path string, filter func(f fs.FileInfo) bool, ...)
- func PrintRunningError(fmtStr string, args ...any)
- func PrintRunningInfo(fmtStr string, args ...any)
- type CommentArgVals
- type GeneratedExtension
- type GeneratedFilesRegistry
Constants ¶
View Source
const ( GeneratedSrcFileExt GeneratedExtension = ".gen.go" GeneratedTestFileExt GeneratedExtension = ".gen_test.go" GeneratedCommentTemplate string = "autoGenComment" AutoGeneratedTemplate string = "// Code generated by {{ .GeneratorName }} - DO NOT EDIT." )
View Source
const (
GeneratorCommentPrefix string = "gen"
)
Variables ¶
View Source
var (
ArgParseExitOnFail bool = true
)
View Source
var CommentArgsMalformed = errors.New("Malformed comment arg.")
View Source
var InvalidGeneratorFileName = errors.New("Invalid generator file name.")
View Source
var MissingRequiredArgs = errors.New("Not all required flags were passed.")
View Source
var UnrecognizedArgs = errors.New("Unrecognized arguments were passed.")
Functions ¶
func CleanFileName ¶
func CommentArgs ¶
func CommentArgs(globalStruct any, comment CommentArgVals) error
func DocArgsAstFilter ¶
func GenFileExclusionFilter ¶
func GetComment ¶
func GetComment( fSet *token.FileSet, srcFile *os.File, doc *ast.CommentGroup, comment *ast.CommentGroup, ) (string, error)
func GetLongGenericsString ¶
func GetProgName ¶
func GetShortGenericsString ¶
func GetSourceTextFromExpr ¶
func InlineArgs ¶
func IterateOverAST ¶
func PrintRunningError ¶
func PrintRunningInfo ¶
Types ¶
type CommentArgVals ¶
func GetDocArgVals ¶
func GetDocArgVals( fSet *token.FileSet, srcFile *os.File, doc *ast.CommentGroup, ) (CommentArgVals, error)
type GeneratedExtension ¶
type GeneratedExtension string
type GeneratedFilesRegistry ¶
func NewGeneratedFilesRegistryFromMap ¶
func NewGeneratedFilesRegistryFromMap( vals map[string]string, ) GeneratedFilesRegistry
func (*GeneratedFilesRegistry) WriteToFile ¶
func (g *GeneratedFilesRegistry) WriteToFile( outFile string, extension GeneratedExtension, templateName string, data any, ) error
Click to show internal directories.
Click to hide internal directories.