codegen

package
v0.0.0-...-d283dcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAPIDocs

func ExtractAPIDocs(module, modelDir string, excludes []string) (gen.APIDocEntries, error)

ExtractAPIDocs extracts the struct doc comments and enum declarations of every exported type declared under modelDir, including custom request and response types; unexported types never reach the API surface and are skipped. Enum constants may live in a different file than their type declaration; entries of the same package are merged. The returned entries are sorted by package path and type name so generated output stays deterministic.

func FindModels

func FindModels(module, modelDir, serviceDir string, excludes []string) ([]*gen.ModelInfo, error)

FindModels finds all model infos in a directory

func FindServiceStruct

func FindServiceStruct(file *ast.File, modelName string) *ast.TypeSpec

FindServiceStruct finds the service struct that inherits from service.Base[*Model]

func HasMethod

func HasMethod(file *ast.File, structName, methodName string) bool

HasMethod checks if a struct has a specific method

func IsServiceBaseType

func IsServiceBaseType(expr ast.Expr, modelName string) bool

IsServiceBaseType checks if the type is service.Base[*ModelName]

Types

This section is empty.

Directories

Path Synopsis
Package codegenast provides AST helpers for codegen; the name avoids conflicting with the standard library "go/ast" package.
Package codegenast provides AST helpers for codegen; the name avoids conflicting with the standard library "go/ast" package.
cmd
apidocgen command
Command apidocgen regenerates the apidoc registration file of the framework package that ships struct doc comments to the OpenAPI generator.
Command apidocgen regenerates the apidoc registration file of the framework package that ships struct doc comments to the OpenAPI generator.
gen
ts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL