Documentation
¶
Index ¶
- func CopyDir(src, dst string) error
- func CopyFile(src, dst string) error
- type APIDocGenerator
- func (g *APIDocGenerator) ExcludeDirectories(dirs ...string) *APIDocGenerator
- func (g *APIDocGenerator) Generate() error
- func (g *APIDocGenerator) IncludeDirectories(dirs ...string) *APIDocGenerator
- func (g *APIDocGenerator) IncludeInternalMethods(include bool) *APIDocGenerator
- func (g *APIDocGenerator) IncludePrivateMethods(include bool) *APIDocGenerator
- func (g *APIDocGenerator) SetAPIVersion(version string) *APIDocGenerator
- func (g *APIDocGenerator) SetAuthor(author string) *APIDocGenerator
- func (g *APIDocGenerator) SetBaseURL(url string) *APIDocGenerator
- func (g *APIDocGenerator) SetDescription(desc string) *APIDocGenerator
- func (g *APIDocGenerator) SetEmail(email string) *APIDocGenerator
- func (g *APIDocGenerator) SetFileExtensions(exts ...string) *APIDocGenerator
- func (g *APIDocGenerator) SetLicense(license string) *APIDocGenerator
- func (g *APIDocGenerator) SetOutputDir(dir string) *APIDocGenerator
- func (g *APIDocGenerator) SetRoutePrefix(prefix string) *APIDocGenerator
- func (g *APIDocGenerator) SetSourceDir(dir string) *APIDocGenerator
- func (g *APIDocGenerator) SetTitle(title string) *APIDocGenerator
- func (g *APIDocGenerator) UseMarkdown(use bool) *APIDocGenerator
- type APIDocumentation
- type APIEndpoint
- type APIExample
- type APIParam
- type APIStatusCode
- type CLIDocGenerator
- type ConfigDocGenerator
- type DatabaseDocGenerator
- type DocumentationGenerator
- func (g *DocumentationGenerator) AddGenerator(generator Generator) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableAPI(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableCLI(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableConfig(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableDatabase(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableModules(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableSearch(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) EnableUI(enable bool) *DocumentationGenerator
- func (g *DocumentationGenerator) Generate() error
- func (g *DocumentationGenerator) SetBaseURL(url string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetCustomCSS(css string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetCustomJS(js string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetDescription(desc string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetFooter(footer string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetGoogleAnalyticsID(id string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetLogoPath(path string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetOutputDir(dir string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetProjectName(name string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetTitle(title string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetUIDir(dir string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetUITheme(theme string) *DocumentationGenerator
- func (g *DocumentationGenerator) SetVersion(version string) *DocumentationGenerator
- type FieldDefinition
- type Generator
- type ModelDefinition
- type ModelDoc
- type ModelDocGenerator
- func (g *ModelDocGenerator) AddModelPackage(path string) *ModelDocGenerator
- func (g *ModelDocGenerator) Generate() error
- func (g *ModelDocGenerator) IgnoreFields(fields ...string) *ModelDocGenerator
- func (g *ModelDocGenerator) IncludeEmbeddedFields(include bool) *ModelDocGenerator
- func (g *ModelDocGenerator) IncludePrivateFields(include bool) *ModelDocGenerator
- func (g *ModelDocGenerator) SetDescription(desc string) *ModelDocGenerator
- func (g *ModelDocGenerator) SetGenerateERDiagram(generate bool) *ModelDocGenerator
- func (g *ModelDocGenerator) SetOutputDir(dir string) *ModelDocGenerator
- func (g *ModelDocGenerator) SetSourceDir(dir string) *ModelDocGenerator
- func (g *ModelDocGenerator) SetTitle(title string) *ModelDocGenerator
- func (g *ModelDocGenerator) UseMarkdown(use bool) *ModelDocGenerator
- type ModuleDocGenerator
- type Relationship
- type SwaggerContact
- type SwaggerDocument
- type SwaggerGenerator
- func (g *SwaggerGenerator) AddBasicAuthSecurityDefinition() *SwaggerGenerator
- func (g *SwaggerGenerator) AddGlobalParameter(name string, parameter interface{}) *SwaggerGenerator
- func (g *SwaggerGenerator) AddGlobalResponse(name string, response interface{}) *SwaggerGenerator
- func (g *SwaggerGenerator) AddJWTSecurityDefinition() *SwaggerGenerator
- func (g *SwaggerGenerator) AddSecurityDefinition(name string, definition interface{}) *SwaggerGenerator
- func (g *SwaggerGenerator) Generate() error
- func (g *SwaggerGenerator) SetHost(host string) *SwaggerGenerator
- func (g *SwaggerGenerator) SetOutputDir(dir string) *SwaggerGenerator
- func (g *SwaggerGenerator) SetSchemes(schemes ...string) *SwaggerGenerator
- type SwaggerInfo
- type SwaggerLicense
- type SwaggerTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIDocGenerator ¶
type APIDocGenerator struct {
// contains filtered or unexported fields
}
APIDocGenerator 用于生成API文档的生成器
func NewAPIDocGenerator ¶
func NewAPIDocGenerator(application *app.Application) *APIDocGenerator
NewAPIDocGenerator 创建新的API文档生成器
func (*APIDocGenerator) ExcludeDirectories ¶
func (g *APIDocGenerator) ExcludeDirectories(dirs ...string) *APIDocGenerator
ExcludeDirectories 设置要排除的目录
func (*APIDocGenerator) IncludeDirectories ¶
func (g *APIDocGenerator) IncludeDirectories(dirs ...string) *APIDocGenerator
IncludeDirectories 设置要包含的目录
func (*APIDocGenerator) IncludeInternalMethods ¶
func (g *APIDocGenerator) IncludeInternalMethods(include bool) *APIDocGenerator
IncludeInternalMethods 是否包含内部方法
func (*APIDocGenerator) IncludePrivateMethods ¶
func (g *APIDocGenerator) IncludePrivateMethods(include bool) *APIDocGenerator
IncludePrivateMethods 是否包含私有方法
func (*APIDocGenerator) SetAPIVersion ¶
func (g *APIDocGenerator) SetAPIVersion(version string) *APIDocGenerator
SetAPIVersion 设置API版本
func (*APIDocGenerator) SetAuthor ¶
func (g *APIDocGenerator) SetAuthor(author string) *APIDocGenerator
SetAuthor 设置作者信息
func (*APIDocGenerator) SetBaseURL ¶
func (g *APIDocGenerator) SetBaseURL(url string) *APIDocGenerator
SetBaseURL 设置基础URL
func (*APIDocGenerator) SetDescription ¶
func (g *APIDocGenerator) SetDescription(desc string) *APIDocGenerator
SetDescription 设置文档描述
func (*APIDocGenerator) SetEmail ¶
func (g *APIDocGenerator) SetEmail(email string) *APIDocGenerator
SetEmail 设置联系邮箱
func (*APIDocGenerator) SetFileExtensions ¶
func (g *APIDocGenerator) SetFileExtensions(exts ...string) *APIDocGenerator
SetFileExtensions 设置要解析的文件扩展名
func (*APIDocGenerator) SetLicense ¶
func (g *APIDocGenerator) SetLicense(license string) *APIDocGenerator
SetLicense 设置许可证信息
func (*APIDocGenerator) SetOutputDir ¶
func (g *APIDocGenerator) SetOutputDir(dir string) *APIDocGenerator
SetOutputDir 设置输出目录
func (*APIDocGenerator) SetRoutePrefix ¶
func (g *APIDocGenerator) SetRoutePrefix(prefix string) *APIDocGenerator
SetRoutePrefix 设置路由前缀
func (*APIDocGenerator) SetSourceDir ¶
func (g *APIDocGenerator) SetSourceDir(dir string) *APIDocGenerator
SetSourceDir 设置源代码目录
func (*APIDocGenerator) SetTitle ¶
func (g *APIDocGenerator) SetTitle(title string) *APIDocGenerator
SetTitle 设置文档标题
func (*APIDocGenerator) UseMarkdown ¶
func (g *APIDocGenerator) UseMarkdown(use bool) *APIDocGenerator
UseMarkdown 是否使用Markdown格式
type APIDocumentation ¶
type APIDocumentation struct {
// 文档标题
Title string `json:"title"`
// 文档描述
Description string `json:"description"`
// API版本
Version string `json:"version"`
// 基础URL
BaseURL string `json:"base_url"`
// 生成时间
GeneratedAt time.Time `json:"generated_at"`
// 作者
Author string `json:"author,omitempty"`
// 联系邮箱
Email string `json:"email,omitempty"`
// 许可证
License string `json:"license,omitempty"`
// API端点列表
Endpoints []APIEndpoint `json:"endpoints"`
// 模型定义
Models map[string]interface{} `json:"models,omitempty"`
}
APIDocumentation 表示整体API文档
type APIEndpoint ¶
type APIEndpoint struct {
// 端点路径
Path string `json:"path"`
// HTTP方法
Method string `json:"method"`
// 端点描述
Description string `json:"description"`
// 处理器函数名称
Handler string `json:"handler"`
// 请求参数
RequestParams []APIParam `json:"request_params,omitempty"`
// 请求体
RequestBody interface{} `json:"request_body,omitempty"`
// 响应体
ResponseBody interface{} `json:"response_body,omitempty"`
// 可能的响应状态码
StatusCodes []APIStatusCode `json:"status_codes,omitempty"`
// 中间件
Middleware []string `json:"middleware,omitempty"`
// 分组名
Group string `json:"group,omitempty"`
// 端点标签(用于分类)
Tags []string `json:"tags,omitempty"`
// 是否废弃
Deprecated bool `json:"deprecated,omitempty"`
// 废弃说明
DeprecationMessage string `json:"deprecation_message,omitempty"`
// 示例请求
Examples []APIExample `json:"examples,omitempty"`
}
APIEndpoint 表示API端点信息
type APIExample ¶
type APIExample struct {
// 示例名称
Name string `json:"name"`
// 示例请求
Request interface{} `json:"request"`
// 示例响应
Response interface{} `json:"response"`
// 示例描述
Description string `json:"description,omitempty"`
}
APIExample 表示API示例
type APIParam ¶
type APIParam struct {
// 参数名
Name string `json:"name"`
// 参数类型
Type string `json:"type"`
// 参数描述
Description string `json:"description"`
// 是否必需
Required bool `json:"required"`
// 默认值
DefaultValue string `json:"default_value,omitempty"`
// 参数位置(路径、查询、头部、正文等)
Location string `json:"location"`
// 验证规则
ValidationRules string `json:"validation_rules,omitempty"`
// 示例值
Example string `json:"example,omitempty"`
}
APIParam 表示API参数信息
type APIStatusCode ¶
type APIStatusCode struct {
// HTTP状态码
Code int `json:"code"`
// 状态描述
Description string `json:"description"`
// 示例响应
Example interface{} `json:"example,omitempty"`
}
APIStatusCode 表示API响应状态码信息
type CLIDocGenerator ¶
type CLIDocGenerator struct {
// contains filtered or unexported fields
}
CLIDocGenerator 用于生成命令行工具文档的生成器
func NewCLIDocGenerator ¶
func NewCLIDocGenerator(application *app.Application) *CLIDocGenerator
NewCLIDocGenerator 创建新的CLI文档生成器
func (*CLIDocGenerator) SetOutputDir ¶
func (g *CLIDocGenerator) SetOutputDir(dir string) *CLIDocGenerator
SetOutputDir 设置输出目录
type ConfigDocGenerator ¶
type ConfigDocGenerator struct {
// contains filtered or unexported fields
}
ConfigDocGenerator 用于生成配置文档的生成器
func NewConfigDocGenerator ¶
func NewConfigDocGenerator(application *app.Application) *ConfigDocGenerator
NewConfigDocGenerator 创建新的配置文档生成器
func (*ConfigDocGenerator) SetOutputDir ¶
func (g *ConfigDocGenerator) SetOutputDir(dir string) *ConfigDocGenerator
SetOutputDir 设置输出目录
type DatabaseDocGenerator ¶
type DatabaseDocGenerator struct {
// contains filtered or unexported fields
}
DatabaseDocGenerator 用于生成数据库文档的生成器
func NewDatabaseDocGenerator ¶
func NewDatabaseDocGenerator(application *app.Application) *DatabaseDocGenerator
NewDatabaseDocGenerator 创建新的数据库文档生成器
func (*DatabaseDocGenerator) Generate ¶
func (g *DatabaseDocGenerator) Generate() error
Generate 生成数据库文档
func (*DatabaseDocGenerator) SetOutputDir ¶
func (g *DatabaseDocGenerator) SetOutputDir(dir string) *DatabaseDocGenerator
SetOutputDir 设置输出目录
type DocumentationGenerator ¶
type DocumentationGenerator struct {
// contains filtered or unexported fields
}
DocumentationGenerator 是整体文档生成器,协调各种类型的文档生成
func NewDocumentationGenerator ¶
func NewDocumentationGenerator(application *app.Application) *DocumentationGenerator
NewDocumentationGenerator 创建新的文档生成器
func (*DocumentationGenerator) AddGenerator ¶
func (g *DocumentationGenerator) AddGenerator(generator Generator) *DocumentationGenerator
AddGenerator 添加自定义生成器
func (*DocumentationGenerator) EnableAPI ¶
func (g *DocumentationGenerator) EnableAPI(enable bool) *DocumentationGenerator
EnableAPI 启用API文档生成
func (*DocumentationGenerator) EnableCLI ¶
func (g *DocumentationGenerator) EnableCLI(enable bool) *DocumentationGenerator
EnableCLI 启用命令行文档生成
func (*DocumentationGenerator) EnableConfig ¶
func (g *DocumentationGenerator) EnableConfig(enable bool) *DocumentationGenerator
EnableConfig 启用配置文档生成
func (*DocumentationGenerator) EnableDatabase ¶
func (g *DocumentationGenerator) EnableDatabase(enable bool) *DocumentationGenerator
EnableDatabase 启用数据库文档生成
func (*DocumentationGenerator) EnableModules ¶
func (g *DocumentationGenerator) EnableModules(enable bool) *DocumentationGenerator
EnableModules 启用模块文档生成
func (*DocumentationGenerator) EnableSearch ¶
func (g *DocumentationGenerator) EnableSearch(enable bool) *DocumentationGenerator
EnableSearch 启用搜索功能
func (*DocumentationGenerator) EnableUI ¶
func (g *DocumentationGenerator) EnableUI(enable bool) *DocumentationGenerator
EnableUI 启用UI生成
func (*DocumentationGenerator) Generate ¶
func (g *DocumentationGenerator) Generate() error
Generate 执行文档生成
func (*DocumentationGenerator) SetBaseURL ¶
func (g *DocumentationGenerator) SetBaseURL(url string) *DocumentationGenerator
SetBaseURL 设置基础URL
func (*DocumentationGenerator) SetCustomCSS ¶
func (g *DocumentationGenerator) SetCustomCSS(css string) *DocumentationGenerator
SetCustomCSS 设置自定义CSS
func (*DocumentationGenerator) SetCustomJS ¶
func (g *DocumentationGenerator) SetCustomJS(js string) *DocumentationGenerator
SetCustomJS 设置自定义JS
func (*DocumentationGenerator) SetDescription ¶
func (g *DocumentationGenerator) SetDescription(desc string) *DocumentationGenerator
SetDescription 设置项目描述
func (*DocumentationGenerator) SetFooter ¶
func (g *DocumentationGenerator) SetFooter(footer string) *DocumentationGenerator
SetFooter 设置页脚
func (*DocumentationGenerator) SetGoogleAnalyticsID ¶
func (g *DocumentationGenerator) SetGoogleAnalyticsID(id string) *DocumentationGenerator
SetGoogleAnalyticsID 设置Google Analytics ID
func (*DocumentationGenerator) SetLogoPath ¶
func (g *DocumentationGenerator) SetLogoPath(path string) *DocumentationGenerator
SetLogoPath 设置Logo路径
func (*DocumentationGenerator) SetOutputDir ¶
func (g *DocumentationGenerator) SetOutputDir(dir string) *DocumentationGenerator
SetOutputDir 设置输出目录
func (*DocumentationGenerator) SetProjectName ¶
func (g *DocumentationGenerator) SetProjectName(name string) *DocumentationGenerator
SetProjectName 设置项目名称
func (*DocumentationGenerator) SetTitle ¶
func (g *DocumentationGenerator) SetTitle(title string) *DocumentationGenerator
SetTitle 设置文档标题
func (*DocumentationGenerator) SetUIDir ¶
func (g *DocumentationGenerator) SetUIDir(dir string) *DocumentationGenerator
SetUIDir 设置UI目录
func (*DocumentationGenerator) SetUITheme ¶
func (g *DocumentationGenerator) SetUITheme(theme string) *DocumentationGenerator
SetUITheme 设置UI主题
func (*DocumentationGenerator) SetVersion ¶
func (g *DocumentationGenerator) SetVersion(version string) *DocumentationGenerator
SetVersion 设置项目版本
type FieldDefinition ¶
type FieldDefinition struct {
// 字段名
Name string `json:"name"`
// 字段描述
Description string `json:"description,omitempty"`
// 字段类型
Type string `json:"type"`
// 字段标签
Tags map[string]string `json:"tags,omitempty"`
// 是否为主键
PrimaryKey bool `json:"primary_key,omitempty"`
// 是否必需
Required bool `json:"required,omitempty"`
// 字段默认值
DefaultValue string `json:"default_value,omitempty"`
// 是否可为空
Nullable bool `json:"nullable,omitempty"`
// 字段注释
Comment string `json:"comment,omitempty"`
// 字段验证规则
ValidationRules string `json:"validation_rules,omitempty"`
// 字段索引名(如果是索引)
IndexName string `json:"index_name,omitempty"`
// 是否唯一
Unique bool `json:"unique,omitempty"`
// 关联模型(如果是外键)
RelatedModel string `json:"related_model,omitempty"`
// 关联字段(如果是外键)
RelatedField string `json:"related_field,omitempty"`
// 字段示例值
Example string `json:"example,omitempty"`
}
FieldDefinition 表示字段定义
type ModelDefinition ¶
type ModelDefinition struct {
// 模型名称
Name string `json:"name"`
// 模型描述
Description string `json:"description"`
// 模型注释
Comment string `json:"comment,omitempty"`
// 模型所在包路径
Package string `json:"package"`
// 对应的数据库表(如果有)
Table string `json:"table,omitempty"`
// 字段定义
Fields []FieldDefinition `json:"fields"`
}
ModelDefinition 表示模型定义
type ModelDoc ¶
type ModelDoc struct {
// 文档标题
Title string `json:"title"`
// 文档描述
Description string `json:"description"`
// 生成时间
GeneratedAt time.Time `json:"generated_at"`
// 模型定义
Models []ModelDefinition `json:"models"`
// 关系定义
Relationships []Relationship `json:"relationships,omitempty"`
}
ModelDoc 表示模型文档
type ModelDocGenerator ¶
type ModelDocGenerator struct {
// contains filtered or unexported fields
}
ModelDocGenerator 用于生成数据模型文档的生成器
func NewModelDocGenerator ¶
func NewModelDocGenerator(application *app.Application) *ModelDocGenerator
NewModelDocGenerator 创建新的模型文档生成器
func (*ModelDocGenerator) AddModelPackage ¶
func (g *ModelDocGenerator) AddModelPackage(path string) *ModelDocGenerator
AddModelPackage 添加模型包路径
func (*ModelDocGenerator) IgnoreFields ¶
func (g *ModelDocGenerator) IgnoreFields(fields ...string) *ModelDocGenerator
IgnoreFields 设置要忽略的字段
func (*ModelDocGenerator) IncludeEmbeddedFields ¶
func (g *ModelDocGenerator) IncludeEmbeddedFields(include bool) *ModelDocGenerator
IncludeEmbeddedFields 设置是否包含嵌入字段
func (*ModelDocGenerator) IncludePrivateFields ¶
func (g *ModelDocGenerator) IncludePrivateFields(include bool) *ModelDocGenerator
IncludePrivateFields 设置是否包含私有字段
func (*ModelDocGenerator) SetDescription ¶
func (g *ModelDocGenerator) SetDescription(desc string) *ModelDocGenerator
SetDescription 设置文档描述
func (*ModelDocGenerator) SetGenerateERDiagram ¶
func (g *ModelDocGenerator) SetGenerateERDiagram(generate bool) *ModelDocGenerator
SetGenerateERDiagram 设置是否生成ER图
func (*ModelDocGenerator) SetOutputDir ¶
func (g *ModelDocGenerator) SetOutputDir(dir string) *ModelDocGenerator
SetOutputDir 设置输出目录
func (*ModelDocGenerator) SetSourceDir ¶
func (g *ModelDocGenerator) SetSourceDir(dir string) *ModelDocGenerator
SetSourceDir 设置源码目录
func (*ModelDocGenerator) SetTitle ¶
func (g *ModelDocGenerator) SetTitle(title string) *ModelDocGenerator
SetTitle 设置文档标题
func (*ModelDocGenerator) UseMarkdown ¶
func (g *ModelDocGenerator) UseMarkdown(use bool) *ModelDocGenerator
UseMarkdown 设置是否使用Markdown格式
type ModuleDocGenerator ¶
type ModuleDocGenerator struct {
// contains filtered or unexported fields
}
ModuleDocGenerator 用于生成模块文档的生成器
func NewModuleDocGenerator ¶
func NewModuleDocGenerator(application *app.Application) *ModuleDocGenerator
NewModuleDocGenerator 创建新的模块文档生成器
func (*ModuleDocGenerator) SetOutputDir ¶
func (g *ModuleDocGenerator) SetOutputDir(dir string) *ModuleDocGenerator
SetOutputDir 设置输出目录
type Relationship ¶
type Relationship struct {
// 源模型
Source string `json:"source"`
// 目标模型
Target string `json:"target"`
// 关系类型(一对一、一对多、多对多)
Type string `json:"type"`
// 源字段
SourceField string `json:"source_field"`
// 目标字段
TargetField string `json:"target_field"`
// 关系描述
Description string `json:"description,omitempty"`
// 中间表(如果是多对多关系)
JoinTable string `json:"join_table,omitempty"`
}
Relationship 表示模型间关系
type SwaggerContact ¶
type SwaggerContact struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Email string `json:"email,omitempty"`
}
SwaggerContact 表示联系人信息
type SwaggerDocument ¶
type SwaggerDocument struct {
Swagger string `json:"swagger"`
Info SwaggerInfo `json:"info"`
Host string `json:"host,omitempty"`
BasePath string `json:"basePath,omitempty"`
Schemes []string `json:"schemes,omitempty"`
Paths map[string]interface{} `json:"paths"`
Definitions map[string]interface{} `json:"definitions,omitempty"`
SecurityDefinitions map[string]interface{} `json:"securityDefinitions,omitempty"`
Tags []SwaggerTag `json:"tags,omitempty"`
}
SwaggerDocument 表示Swagger文档
type SwaggerGenerator ¶
type SwaggerGenerator struct {
// contains filtered or unexported fields
}
SwaggerGenerator 用于生成Swagger规范文档
func NewSwaggerGenerator ¶
func NewSwaggerGenerator(apiGenerator *APIDocGenerator) *SwaggerGenerator
NewSwaggerGenerator 创建新的Swagger文档生成器
func (*SwaggerGenerator) AddBasicAuthSecurityDefinition ¶
func (g *SwaggerGenerator) AddBasicAuthSecurityDefinition() *SwaggerGenerator
AddBasicAuthSecurityDefinition 添加基本认证安全定义
func (*SwaggerGenerator) AddGlobalParameter ¶
func (g *SwaggerGenerator) AddGlobalParameter(name string, parameter interface{}) *SwaggerGenerator
AddGlobalParameter 添加全局参数
func (*SwaggerGenerator) AddGlobalResponse ¶
func (g *SwaggerGenerator) AddGlobalResponse(name string, response interface{}) *SwaggerGenerator
AddGlobalResponse 添加全局响应
func (*SwaggerGenerator) AddJWTSecurityDefinition ¶
func (g *SwaggerGenerator) AddJWTSecurityDefinition() *SwaggerGenerator
AddJWTSecurityDefinition 添加JWT安全定义
func (*SwaggerGenerator) AddSecurityDefinition ¶
func (g *SwaggerGenerator) AddSecurityDefinition(name string, definition interface{}) *SwaggerGenerator
AddSecurityDefinition 添加安全定义
func (*SwaggerGenerator) Generate ¶
func (g *SwaggerGenerator) Generate() error
Generate 生成Swagger文档
func (*SwaggerGenerator) SetHost ¶
func (g *SwaggerGenerator) SetHost(host string) *SwaggerGenerator
SetHost 设置主机名
func (*SwaggerGenerator) SetOutputDir ¶
func (g *SwaggerGenerator) SetOutputDir(dir string) *SwaggerGenerator
SetOutputDir 设置输出目录
func (*SwaggerGenerator) SetSchemes ¶
func (g *SwaggerGenerator) SetSchemes(schemes ...string) *SwaggerGenerator
SetSchemes 设置协议
type SwaggerInfo ¶
type SwaggerInfo struct {
Title string `json:"title"`
Description string `json:"description"`
Version string `json:"version"`
Contact *SwaggerContact `json:"contact,omitempty"`
License *SwaggerLicense `json:"license,omitempty"`
}
SwaggerInfo 表示Swagger信息
type SwaggerLicense ¶
SwaggerLicense 表示许可证信息
type SwaggerTag ¶
type SwaggerTag struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
SwaggerTag 表示API分组标签