Versions in this module Expand all Collapse all v1 v1.7.115 Mar 15, 2021 v1.7.105 Mar 5, 2021 Changes in this version + const ARRAY + const BOOLEAN + const CamelCase + const FUNC + const INTEGER + const NUMBER + const Name + const OBJECT + const PRIMITIVE + const PascalCase + const STRING + const SnakeCase + const Version + var ErrFailedConvertPrimitiveType = errors.New("swag property: failed convert primitive type") + var ErrFuncTypeField = errors.New("field type is func") + var ErrRecursiveParseStruct = errors.New("recursively parsing struct") + func BuildCustomSchema(types []string) (*spec.Schema, error) + func CheckSchemaType(typeName string) error + func IsGolangPrimitiveType(typeName string) bool + func IsNumericType(typeName string) bool + func IsPrimitiveType(typeName string) bool + func IsSimplePrimitiveType(typeName string) bool + func PrimitiveSchema(refType string) *spec.Schema + func Printf(format string, v ...interface{}) + func Println(v ...interface{}) + func ReadDoc() (string, error) + func RefSchema(refType string) *spec.Schema + func Register(name string, swagger Swagger) + func SetCodeExampleFilesDirectory(directoryPath string) func(*Operation) + func SetCodeExamplesDirectory(directoryPath string) func(*Parser) + func SetExcludedDirsAndFiles(excludes string) func(*Parser) + func SetMarkdownFileDirectory(directoryPath string) func(*Parser) + func TransToValidCollectionFormat(format string) string + func TransToValidSchemeType(typeName string) string + func TypeDocName(pkgName string, spec *ast.TypeSpec) string + type AstFileInfo struct + File *ast.File + PackagePath string + Path string + type Operation struct + HTTPMethod string + Path string + func NewOperation(parser *Parser, options ...func(*Operation)) *Operation + func (operation *Operation) AddResponse(code int, response *spec.Response) + func (operation *Operation) DefaultResponse() *spec.Response + func (operation *Operation) ParseAcceptComment(commentLine string) error + func (operation *Operation) ParseCodeSample(attribute, commentLine, lineRemainder string) error + func (operation *Operation) ParseComment(comment string, astFile *ast.File) error + func (operation *Operation) ParseDescriptionComment(lineRemainder string) + func (operation *Operation) ParseEmptyResponseComment(commentLine string) error + func (operation *Operation) ParseEmptyResponseOnly(commentLine string) error + func (operation *Operation) ParseMetadata(attribute, lowerAttribute, lineRemainder string) error + func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.File) error + func (operation *Operation) ParseProduceComment(commentLine string) error + func (operation *Operation) ParseResponseComment(commentLine string, astFile *ast.File) error + func (operation *Operation) ParseResponseHeaderComment(commentLine string, astFile *ast.File) error + func (operation *Operation) ParseRouterComment(commentLine string) error + func (operation *Operation) ParseSecurityComment(commentLine string) error + func (operation *Operation) ParseTagsComment(commentLine string) + type PackageDefinitions struct + Files map[string]*ast.File + Name string + TypeDefinitions map[string]*TypeSpecDef + type PackagesDefinitions struct + func NewPackagesDefinitions() *PackagesDefinitions + func (pkgs *PackagesDefinitions) CollectAstFile(packageDir, path string, astFile *ast.File) + func (pkgs *PackagesDefinitions) FindTypeSpec(typeName string, file *ast.File) *TypeSpecDef + func (pkgs *PackagesDefinitions) ParseTypes() (map[*TypeSpecDef]*Schema, error) + func (pkgs *PackagesDefinitions) RangeFiles(handle func(filename string, file *ast.File) error) error + type Parser struct + ParseDependency bool + ParseInternal bool + ParseVendor bool + PropNamingStrategy string + func New(options ...func(*Parser)) *Parser + func (parser *Parser) GetSchemaTypePath(schema *spec.Schema, depth int) []string + func (parser *Parser) GetSwagger() *spec.Swagger + func (parser *Parser) ParseAPI(searchDir, mainAPIFile string, parseDepth int) error + func (parser *Parser) ParseDefinition(typeSpecDef *TypeSpecDef) (*Schema, error) + func (parser *Parser) ParseGeneralAPIInfo(mainAPIFile string) error + func (parser *Parser) ParseRouterAPIInfo(fileName string, astFile *ast.File) error + func (parser *Parser) Skip(path string, f os.FileInfo) error + type Schema struct + Name string + PkgPath string + type Swagger interface + ReadDoc func() string + type TypeSpecDef struct + File *ast.File + PkgPath string + TypeSpec *ast.TypeSpec + func (t *TypeSpecDef) FullName() string + func (t *TypeSpecDef) Name() string