constants

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType               = "Content-Type"
	HeaderAccessControlAllowOrigin  = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers"
	CORSAllowAll                    = "*"
	CORSDefaultMethods              = "GET, POST, PUT, DELETE, OPTIONS"
	CORSDefaultHeaders              = "Content-Type, Authorization"
	HTTPMethodOptions               = "OPTIONS"
)
View Source
const (
	MimeApplicationJSON        = "application/json"
	MimeApplicationJSONCharset = "application/json; charset=utf-8"
	MimeTextHTMLCharset        = "text/html; charset=utf-8"
	MimeYAML                   = "yaml"
	MimeYML                    = "yml"
)
View Source
const (
	FileExtYAML = ".yaml"
	FileExtYML  = ".yml"
	FileExtJSON = ".json"
)
View Source
const (
	JSONPath      = "/swagger.json"
	ServicesPath  = "/services"
	DocumentsPath = "/documents"
	AggregatePath = "/aggregate.json"
	DebugPath     = "/debug/services"
	IndexHTML     = "/index.html"
	JSONExt       = ".json"
)
View Source
const (
	PathSeparator      = "/"
	PathServicePrefix  = "/services/"
	PathDocumentPrefix = "/documents/"
)
View Source
const (
	HTMLLangEN       = "en"
	HTMLLangZH       = "zh-CN"
	HTMLCharset      = "UTF-8"
	HTMLMetaViewport = "width=device-width, initial-scale=1.0"
	HTMLIconSizes32  = "32x32"
	HTMLIconSizes16  = "16x16"
)
View Source
const (
	UILayout = "StandaloneLayout"
	UIDomID  = "#swagger-ui"
)
View Source
const (
	JSONIndentPrefix = ""
	JSONIndentValue  = "  "
)
View Source
const (
	FieldTotalServices      = "total_services"
	FieldLoadedServices     = "loaded_services"
	FieldConfiguredServices = "configured_services"
	FieldTimestamp          = "timestamp"
	FieldSpecPath           = "spec_path"
)
View Source
const (
	DefaultTimeout         = 30 * time.Second
	DefaultRefreshInterval = 5 * time.Minute
)
View Source
const (
	FieldRef        = "$ref"
	FieldPaths      = "paths"
	FieldDefs       = "definitions"
	FieldTags       = "tags"
	FieldParameters = "parameters"
	PathDefinitions = "#/definitions/"
)
View Source
const (
	FieldInfo             = "info"
	FieldSwagger          = "swagger"
	FieldConsumes         = "consumes"
	FieldProduces         = "produces"
	FieldBasePath         = "basePath"
	FieldXAggregateInfo   = "x-aggregate-info"
	FieldXDocumentInfo    = "x-document-info"
	FieldXServiceSelector = "x-service-selector"
	FieldServices         = "services"
	FieldDocuments        = "documents"
	FieldName             = "name"
	FieldDescription      = "description"
	FieldVersion          = "version"
	FieldEnabled          = "enabled"
	FieldMode             = "mode"
	FieldUpdated          = "updated"
	FieldCount            = "count"
	FieldTitle            = "title"
	FieldContact          = "contact"
	FieldLicense          = "license"
	FieldEmail            = "email"
	FieldURL              = "url"
)
View Source
const (
	AggregateModeMerge    = "merge"
	AggregateModeSelector = "selector"
)
View Source
const (
	SpecVersion = "2.0"
)

Variables

ValidHTTPMethods Swagger 规范中合法的 HTTP 操作方法(大写)

Functions

func IsValidHTTPMethod

func IsValidHTTPMethod(method string) bool

IsValidHTTPMethod 判断是否是合法的 Swagger 操作方法

func NormalizeHTTPMethod

func NormalizeHTTPMethod(method string) string

NormalizeHTTPMethod 将 HTTP 方法名标准化为大写,不合法时返回空字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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