Versions in this module Expand all Collapse all v0 v0.0.3 Jan 26, 2025 v0.0.2 Oct 16, 2024 Changes in this version + func FindGoMod(filePath string) (*os.File, error) v0.0.1 Oct 13, 2024 Changes in this version + func AppendImportStatements(src []byte, appendImports []byte) []byte + func CollectStructsInFolder(dir string, sc *StructCollector) + func ElementType(t string) string + func ExprString(expr ast.Expr) string + func FixImport(src []byte, file string) + func GetImportPath(dir string) string + func GetImportStatements(input []byte) []byte + func GetMod() string + func GetPkgPath(filePath string) string + func GrpcRelatedModify(src []byte, metaName string, grpcSvcName string) []byte + func IsSlice(t string) bool + func IsVarargs(t string) bool + func Pattern(method string) (httpMethod string, endpoint string) + func RestRelatedModify(src []byte, metaName string) []byte + func RewriteTag(config RewriteTagConfig) (string, error) + func ToSlice(t string) string + func Visit(files *[]string) filepath.WalkFunc + type Annotation struct + Name string + Params []string + func GetAnnotations(text string) []Annotation + type EnumCollector struct + Consts map[string][]string + Methods map[string][]MethodMeta + Package PackageMeta + func EnumsOf(file string, exprString func(ast.Expr) string) *EnumCollector + func NewEnumCollector(exprString func(ast.Expr) string) *EnumCollector + func (sc *EnumCollector) Collect(n ast.Node) ast.Visitor + func (sc *EnumCollector) Visit(n ast.Node) ast.Visitor + type EnumMeta struct + Name string + Values []string + type FieldMeta struct + Annotations []Annotation + Comments []string + DocName string + IsExport bool + IsPathVariable bool + Name string + Tag string + Type string + ValidateTag string + type InterfaceCollector struct + Interfaces []InterfaceMeta + Package PackageMeta + func BuildInterfaceCollector(file string, exprString func(ast.Expr) string) InterfaceCollector + func NewInterfaceCollector(exprString func(ast.Expr) string) *InterfaceCollector + func (ic *InterfaceCollector) Collect(n ast.Node) ast.Visitor + func (ic *InterfaceCollector) Visit(n ast.Node) ast.Visitor + type InterfaceMeta struct + Comments []string + Methods []MethodMeta + Name string + type MethodMeta struct + Annotations []Annotation + BodyJSON *FieldMeta + BodyParams *FieldMeta + Comments []string + Files []FieldMeta + HasPathVariable bool + HeaderVars []FieldMeta + HttpMethod string + Name string + Params []FieldMeta + Path string + PathVars []FieldMeta + QueryParams *FieldMeta + QueryVars []FieldMeta + Recv string + Results []FieldMeta + func GetMethodMeta(spec *ast.FuncDecl) MethodMeta + func NewMethodMeta(ft *ast.FuncType, exprString func(ast.Expr) string) MethodMeta + func (mm MethodMeta) String() string + type PackageMeta struct + Name string + type RewriteTagConfig struct + ConvertFunc func(old string) string + File string + Form bool + Omitempty bool + type StaticMethodCollector struct + Methods []MethodMeta + Package PackageMeta + func BuildStaticMethodCollector(file string, exprString func(ast.Expr) string) StaticMethodCollector + func NewStaticMethodCollector(exprString func(ast.Expr) string, opts ...StaticMethodCollectorOption) *StaticMethodCollector + func (sc *StaticMethodCollector) Collect(n ast.Node) ast.Visitor + func (sc *StaticMethodCollector) Visit(n ast.Node) ast.Visitor + type StaticMethodCollectorOption func(collector *StaticMethodCollector) + type StructCollector struct + GlobalStructs []StructMeta + Methods map[string][]MethodMeta + NonStructTypeMap map[string]ast.Expr + Package PackageMeta + Structs []StructMeta + func BuildStructCollector(file string, exprString func(ast.Expr) string) StructCollector + func NewStructCollector(exprString func(ast.Expr) string, opts ...StructCollectorOption) *StructCollector + func (sc *StructCollector) Collect(n ast.Node) ast.Visitor + func (sc *StructCollector) DocFlatEmbed() []StructMeta + func (sc *StructCollector) Visit(n ast.Node) ast.Visitor + type StructCollectorOption func(collector *StructCollector) + func WithEnums(enums map[string]EnumMeta) StructCollectorOption + type StructMeta struct + Comments []string + Fields []FieldMeta + IsExport bool + Methods []MethodMeta + Name string + Version string + func NewStructMeta(structType *ast.StructType, exprString func(ast.Expr) string) StructMeta