Versions in this module Expand all Collapse all v1 v1.8.2 Aug 17, 2022 v1.0.1 Aug 17, 2022 Changes in this version + const ANY + const ARRAY + const BOOLEAN + const CamelCase + const ERROR + const FUNC + const INTEGER + const INTERFACE + const IgnoreNameOverridePrefix + const NIL + 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") + var ErrSkippedField = errors.New("field is skipped by global overrides") + func BuildCustomSchema(types []string) (*spec.Schema, error) + func CheckSchemaType(typeName string) error + func IsGolangPrimitiveType(typeName string) bool + func IsInterfaceLike(typeName string) bool + func IsNumericType(typeName string) bool + func IsPrimitiveType(typeName string) bool + func IsSimplePrimitiveType(typeName string) bool + func ParseUsingGoList(enabled bool) func(parser *Parser) + func PrimitiveSchema(refType string) *spec.Schema + func ReadDoc(optionalName ...string) (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 SetDebugger(logger Debugger) func(parser *Parser) + func SetExcludedDirsAndFiles(excludes string) func(*Parser) + func SetFieldParserFactory(factory FieldParserFactory) func(parser *Parser) + func SetMarkdownFileDirectory(directoryPath string) func(*Parser) + func SetOverrides(overrides map[string]string) func(parser *Parser) + func SetStrict(strict bool) func(*Parser) + func TransToValidCollectionFormat(format string) string + func TransToValidSchemeType(typeName string) string + func TypeDocName(pkgName string, spec *ast.TypeSpec) string + func TypeDocNameFuncScoped(pkgName string, spec *ast.TypeSpec, fnName string) string + type AstFileInfo struct + File *ast.File + PackagePath string + Path string + type Debugger interface + Printf func(format string, v ...interface{}) + type FieldParser interface + ComplementSchema func(schema *spec.Schema) error + CustomSchema func() (*spec.Schema, error) + FieldName func() (string, error) + IsRequired func() (bool, error) + ShouldSkip func() bool + type FieldParserFactory func(ps *Parser, field *ast.Field) FieldParser + type Formatter struct + func NewFormatter() *Formatter + func (f *Formatter) Format(fileName string, contents []byte) ([]byte, error) + type Operation struct + RouterProperties []RouteProperties + 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, _, 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, _ *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 (pkgDefs *PackagesDefinitions) CollectAstFile(packageDir, path string, astFile *ast.File) error + func (pkgDefs *PackagesDefinitions) FindTypeSpec(typeName string, file *ast.File, parseDependency bool) *TypeSpecDef + func (pkgDefs *PackagesDefinitions) ParseTypes() (map[*TypeSpecDef]*Schema, error) + type Parser struct + Overrides map[string]string + ParseDependency bool + ParseInternal bool + ParseVendor bool + PropNamingStrategy string + RequiredByDefault bool + Strict bool + 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 string, mainAPIFile string, parseDepth int) error + func (parser *Parser) ParseAPIMultiSearchDir(searchDirs []string, mainAPIFile string, parseDepth int) error + func (parser *Parser) ParseAcceptComment(commentLine string) error + func (parser *Parser) ParseDefinition(typeSpecDef *TypeSpecDef) (*Schema, error) + func (parser *Parser) ParseGeneralAPIInfo(mainAPIFile string) error + func (parser *Parser) ParseProduceComment(commentLine string) error + func (parser *Parser) ParseRouterAPIInfo(fileName string, astFile *ast.File) error + func (parser *Parser) Skip(path string, f os.FileInfo) error + type RouteProperties struct + HTTPMethod string + Path string + type Schema struct + Name string + PkgPath string + type Spec struct + BasePath string + Description string + Host string + InfoInstanceName string + Schemes []string + SwaggerTemplate string + Title string + Version string + func (i *Spec) InstanceName() string + func (i *Spec) ReadDoc() string + type Swagger interface + ReadDoc func() string + type TypeSpecDef struct + File *ast.File + ParentSpec ast.Decl + PkgPath string + TypeSpec *ast.TypeSpec + func (t *TypeSpecDef) FullName() string + func (t *TypeSpecDef) FullPath() string + func (t *TypeSpecDef) Name() string