conf

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

Swagger Plugin Configuration Description

Configuration Files

This directory contains configuration-related files for the Swagger plugin:

File List
  1. swagger.proto - Protobuf configuration definition file
  2. swagger.pb.go - Auto-generated Go code (generated by protoc)
  3. swagger.yml - Complete configuration example (includes all available options)
  4. swagger-simple.yml - Simple configuration example (quick start)

Configuration Usage Methods

1. Using Configuration in Projects

Create a config.yaml or config.yml file in your project root directory, referencing the examples in this directory for configuration:

# config.yaml
lynx:
  swagger:
    enabled: true
    gen:
      scan_dirs: ["./controllers"]
      output_path: "./docs/swagger.json"
    ui:
      enabled: true
      port: 8080
      path: "/swagger"
2. Configuration Priority

Configuration loading priority (from high to low):

  1. Environment variables
  2. Command line arguments
  3. Configuration file (config.yaml)
  4. Default values
3. Main Configuration Items Description
Basic Configuration
  • enabled: Whether to enable the plugin
  • gen.enabled: Whether to enable documentation generation
  • ui.enabled: Whether to enable UI service
Scan Configuration
  • gen.scan_dirs: List of directories to scan
  • gen.exclude_dirs: Excluded directories
  • gen.recursive: Whether to scan recursively
UI Configuration
  • ui.port: UI service port
  • ui.path: UI access path
  • ui.title: Page title
API Information
  • info.title: API title
  • info.version: API version
  • info.description: API description
4. Environment Variable Configuration

Supports overriding configuration via environment variables:

# Enable Swagger
export LYNX_SWAGGER_ENABLED=true

# Set UI port
export LYNX_SWAGGER_UI_PORT=8080

# Set scan directories
export LYNX_SWAGGER_GEN_SCAN_DIRS="./controllers,./handlers"
5. Minimal Configuration Example
lynx:
  swagger:
    enabled: true

This will use default configuration:

  • Scan current directory
  • Output to ./docs/swagger.json
  • UI service at http://localhost:8080/swagger
6. Production Environment Configuration Recommendations
lynx:
  swagger:
    enabled: true
    gen:
      enabled: false  # Disable auto-generation in production
      watch_enabled: false  # Disable file monitoring
    ui:
      enabled: true
      port: 8080
      path: "/api-docs"  # Use different path
    security_definitions:
      bearer_auth:
        type: "apiKey"
        name: "Authorization"
        in: "header"
    security:
      - bearer_auth: []  # Enable authentication
7. Development Environment Configuration Recommendations
lynx:
  swagger:
    enabled: true
    gen:
      enabled: true
      watch_enabled: true  # Enable hot updates
      watch_interval: 3s
    ui:
      enabled: true
      auto_refresh: true  # Auto-refresh UI
      refresh_interval: 3000
    advanced:
      pretty_json: true  # Beautify output
      validate_spec: true  # Validate specification

Configuration Validation

Use the following commands to validate if the configuration is correct:

# Validate configuration file format
go run main.go --validate-config

# View final effective configuration
go run main.go --show-config

Common Issues

Q: How to disable Swagger in production environment?

A: Set enabled: false or environment variable LYNX_SWAGGER_ENABLED=false

Q: How to change UI access address?

A: Modify ui.port and ui.path configuration

Q: How to add API authentication?

A: Configure security_definitions and security options

Q: Documentation not updating automatically?

A: Ensure gen.watch_enabled: true and have file write permissions

More Information

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_swagger_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type API

type API struct {

	// API title
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// API description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// API version
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// API terms of service
	TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"`
	// API contact information
	Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"`
	// API license information
	License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"`
	// API host
	Host string `protobuf:"bytes,7,opt,name=host,proto3" json:"host,omitempty"`
	// API base path
	BasePath string `protobuf:"bytes,8,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"`
	// API schemes (http, https, ws, wss)
	Schemes []string `protobuf:"bytes,9,rep,name=schemes,proto3" json:"schemes,omitempty"`
	// API consumes (content types)
	Consumes []string `protobuf:"bytes,10,rep,name=consumes,proto3" json:"consumes,omitempty"`
	// API produces (content types)
	Produces []string `protobuf:"bytes,11,rep,name=produces,proto3" json:"produces,omitempty"`
	// API tags
	Tags []*Tag `protobuf:"bytes,12,rep,name=tags,proto3" json:"tags,omitempty"`
	// API external docs
	ExternalDocs *ExternalDocs `protobuf:"bytes,13,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
	// contains filtered or unexported fields
}

API documentation configuration

func (*API) Descriptor deprecated

func (*API) Descriptor() ([]byte, []int)

Deprecated: Use API.ProtoReflect.Descriptor instead.

func (*API) GetBasePath

func (x *API) GetBasePath() string

func (*API) GetConsumes

func (x *API) GetConsumes() []string

func (*API) GetContact

func (x *API) GetContact() *Contact

func (*API) GetDescription

func (x *API) GetDescription() string

func (*API) GetExternalDocs

func (x *API) GetExternalDocs() *ExternalDocs

func (*API) GetHost

func (x *API) GetHost() string

func (*API) GetLicense

func (x *API) GetLicense() *License

func (*API) GetProduces

func (x *API) GetProduces() []string

func (*API) GetSchemes

func (x *API) GetSchemes() []string

func (*API) GetTags

func (x *API) GetTags() []*Tag

func (*API) GetTermsOfService

func (x *API) GetTermsOfService() string

func (*API) GetTitle

func (x *API) GetTitle() string

func (*API) GetVersion

func (x *API) GetVersion() string

func (*API) ProtoMessage

func (*API) ProtoMessage()

func (*API) ProtoReflect

func (x *API) ProtoReflect() protoreflect.Message

func (*API) Reset

func (x *API) Reset()

func (*API) String

func (x *API) String() string

type APIKey

type APIKey struct {

	// API key name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// API key in (header, query, cookie)
	In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"`
	// API key description
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

API key configuration

func (*APIKey) Descriptor deprecated

func (*APIKey) Descriptor() ([]byte, []int)

Deprecated: Use APIKey.ProtoReflect.Descriptor instead.

func (*APIKey) GetDescription

func (x *APIKey) GetDescription() string

func (*APIKey) GetIn

func (x *APIKey) GetIn() string

func (*APIKey) GetName

func (x *APIKey) GetName() string

func (*APIKey) ProtoMessage

func (*APIKey) ProtoMessage()

func (*APIKey) ProtoReflect

func (x *APIKey) ProtoReflect() protoreflect.Message

func (*APIKey) Reset

func (x *APIKey) Reset()

func (*APIKey) String

func (x *APIKey) String() string

type BasicAuth

type BasicAuth struct {

	// Enable basic authentication
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// Basic auth description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

Basic authentication configuration

func (*BasicAuth) Descriptor deprecated

func (*BasicAuth) Descriptor() ([]byte, []int)

Deprecated: Use BasicAuth.ProtoReflect.Descriptor instead.

func (*BasicAuth) GetDescription

func (x *BasicAuth) GetDescription() string

func (*BasicAuth) GetEnable

func (x *BasicAuth) GetEnable() bool

func (*BasicAuth) ProtoMessage

func (*BasicAuth) ProtoMessage()

func (*BasicAuth) ProtoReflect

func (x *BasicAuth) ProtoReflect() protoreflect.Message

func (*BasicAuth) Reset

func (x *BasicAuth) Reset()

func (*BasicAuth) String

func (x *BasicAuth) String() string

type Contact

type Contact struct {

	// Contact name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Contact URL
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// Contact email
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

Contact information

func (*Contact) Descriptor deprecated

func (*Contact) Descriptor() ([]byte, []int)

Deprecated: Use Contact.ProtoReflect.Descriptor instead.

func (*Contact) GetEmail

func (x *Contact) GetEmail() string

func (*Contact) GetName

func (x *Contact) GetName() string

func (*Contact) GetUrl

func (x *Contact) GetUrl() string

func (*Contact) ProtoMessage

func (*Contact) ProtoMessage()

func (*Contact) ProtoReflect

func (x *Contact) ProtoReflect() protoreflect.Message

func (*Contact) Reset

func (x *Contact) Reset()

func (*Contact) String

func (x *Contact) String() string

type Custom

type Custom struct {

	// Custom CSS
	CustomCss string `protobuf:"bytes,1,opt,name=custom_css,json=customCss,proto3" json:"custom_css,omitempty"`
	// Custom JavaScript
	CustomJs string `protobuf:"bytes,2,opt,name=custom_js,json=customJs,proto3" json:"custom_js,omitempty"`
	// Custom HTML
	CustomHtml string `protobuf:"bytes,3,opt,name=custom_html,json=customHtml,proto3" json:"custom_html,omitempty"`
	// Custom favicon
	CustomFavicon string `protobuf:"bytes,4,opt,name=custom_favicon,json=customFavicon,proto3" json:"custom_favicon,omitempty"`
	CustomLogo string `protobuf:"bytes,5,opt,name=custom_logo,json=customLogo,proto3" json:"custom_logo,omitempty"`
	// Custom footer
	CustomFooter string `protobuf:"bytes,6,opt,name=custom_footer,json=customFooter,proto3" json:"custom_footer,omitempty"`
	// Custom header
	CustomHeader string `protobuf:"bytes,7,opt,name=custom_header,json=customHeader,proto3" json:"custom_header,omitempty"`
	// Custom navigation
	CustomNavigation string `protobuf:"bytes,8,opt,name=custom_navigation,json=customNavigation,proto3" json:"custom_navigation,omitempty"`
	// Custom sidebar
	CustomSidebar string `protobuf:"bytes,9,opt,name=custom_sidebar,json=customSidebar,proto3" json:"custom_sidebar,omitempty"`
	// Custom search
	CustomSearch string `protobuf:"bytes,10,opt,name=custom_search,json=customSearch,proto3" json:"custom_search,omitempty"`
	// Custom authentication
	CustomAuthentication string `protobuf:"bytes,11,opt,name=custom_authentication,json=customAuthentication,proto3" json:"custom_authentication,omitempty"`
	// Custom authorization
	CustomAuthorization string `protobuf:"bytes,12,opt,name=custom_authorization,json=customAuthorization,proto3" json:"custom_authorization,omitempty"`
	// Custom validation
	CustomValidation string `protobuf:"bytes,13,opt,name=custom_validation,json=customValidation,proto3" json:"custom_validation,omitempty"`
	// Custom transformation
	CustomTransformation string `protobuf:"bytes,14,opt,name=custom_transformation,json=customTransformation,proto3" json:"custom_transformation,omitempty"`
	// Custom formatting
	CustomFormatting string `protobuf:"bytes,15,opt,name=custom_formatting,json=customFormatting,proto3" json:"custom_formatting,omitempty"`
	// contains filtered or unexported fields
}

Custom configuration

func (*Custom) Descriptor deprecated

func (*Custom) Descriptor() ([]byte, []int)

Deprecated: Use Custom.ProtoReflect.Descriptor instead.

func (*Custom) GetCustomAuthentication

func (x *Custom) GetCustomAuthentication() string

func (*Custom) GetCustomAuthorization

func (x *Custom) GetCustomAuthorization() string

func (*Custom) GetCustomCss

func (x *Custom) GetCustomCss() string

func (*Custom) GetCustomFavicon

func (x *Custom) GetCustomFavicon() string

func (*Custom) GetCustomFooter

func (x *Custom) GetCustomFooter() string

func (*Custom) GetCustomFormatting

func (x *Custom) GetCustomFormatting() string

func (*Custom) GetCustomHeader

func (x *Custom) GetCustomHeader() string

func (*Custom) GetCustomHtml

func (x *Custom) GetCustomHtml() string

func (*Custom) GetCustomJs

func (x *Custom) GetCustomJs() string
func (x *Custom) GetCustomLogo() string

func (*Custom) GetCustomNavigation

func (x *Custom) GetCustomNavigation() string

func (*Custom) GetCustomSearch

func (x *Custom) GetCustomSearch() string

func (*Custom) GetCustomSidebar

func (x *Custom) GetCustomSidebar() string

func (*Custom) GetCustomTransformation

func (x *Custom) GetCustomTransformation() string

func (*Custom) GetCustomValidation

func (x *Custom) GetCustomValidation() string

func (*Custom) ProtoMessage

func (*Custom) ProtoMessage()

func (*Custom) ProtoReflect

func (x *Custom) ProtoReflect() protoreflect.Message

func (*Custom) Reset

func (x *Custom) Reset()

func (*Custom) String

func (x *Custom) String() string

type ExternalDocs

type ExternalDocs struct {

	// External docs description
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// External docs URL
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

External documentation

func (*ExternalDocs) Descriptor deprecated

func (*ExternalDocs) Descriptor() ([]byte, []int)

Deprecated: Use ExternalDocs.ProtoReflect.Descriptor instead.

func (*ExternalDocs) GetDescription

func (x *ExternalDocs) GetDescription() string

func (*ExternalDocs) GetUrl

func (x *ExternalDocs) GetUrl() string

func (*ExternalDocs) ProtoMessage

func (*ExternalDocs) ProtoMessage()

func (*ExternalDocs) ProtoReflect

func (x *ExternalDocs) ProtoReflect() protoreflect.Message

func (*ExternalDocs) Reset

func (x *ExternalDocs) Reset()

func (*ExternalDocs) String

func (x *ExternalDocs) String() string

type Generation

type Generation struct {

	// Enable auto-generation
	AutoGenerate bool `protobuf:"varint,1,opt,name=auto_generate,json=autoGenerate,proto3" json:"auto_generate,omitempty"`
	// Generation interval
	GenerationInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=generation_interval,json=generationInterval,proto3" json:"generation_interval,omitempty"`
	// Output format (json, yaml)
	OutputFormat string `protobuf:"bytes,3,opt,name=output_format,json=outputFormat,proto3" json:"output_format,omitempty"`
	// Output path
	OutputPath string `protobuf:"bytes,4,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"`
	// Include deprecated APIs
	IncludeDeprecated bool `protobuf:"varint,5,opt,name=include_deprecated,json=includeDeprecated,proto3" json:"include_deprecated,omitempty"`
	// Include examples
	IncludeExamples bool `protobuf:"varint,6,opt,name=include_examples,json=includeExamples,proto3" json:"include_examples,omitempty"`
	// Include descriptions
	IncludeDescriptions bool `protobuf:"varint,7,opt,name=include_descriptions,json=includeDescriptions,proto3" json:"include_descriptions,omitempty"`
	// Include response schemas
	IncludeResponseSchemas bool `` /* 130-byte string literal not displayed */
	// Include request schemas
	IncludeRequestSchemas bool `` /* 127-byte string literal not displayed */
	// Include security definitions
	IncludeSecurityDefinitions bool `` /* 143-byte string literal not displayed */
	// Include tags
	IncludeTags bool `protobuf:"varint,11,opt,name=include_tags,json=includeTags,proto3" json:"include_tags,omitempty"`
	// Include external docs
	IncludeExternalDocs bool `protobuf:"varint,12,opt,name=include_external_docs,json=includeExternalDocs,proto3" json:"include_external_docs,omitempty"`
	// Custom templates path
	CustomTemplatesPath string `protobuf:"bytes,13,opt,name=custom_templates_path,json=customTemplatesPath,proto3" json:"custom_templates_path,omitempty"`
	// Custom functions path
	CustomFunctionsPath string `protobuf:"bytes,14,opt,name=custom_functions_path,json=customFunctionsPath,proto3" json:"custom_functions_path,omitempty"`
	// contains filtered or unexported fields
}

Documentation generation configuration

func (*Generation) Descriptor deprecated

func (*Generation) Descriptor() ([]byte, []int)

Deprecated: Use Generation.ProtoReflect.Descriptor instead.

func (*Generation) GetAutoGenerate

func (x *Generation) GetAutoGenerate() bool

func (*Generation) GetCustomFunctionsPath

func (x *Generation) GetCustomFunctionsPath() string

func (*Generation) GetCustomTemplatesPath

func (x *Generation) GetCustomTemplatesPath() string

func (*Generation) GetGenerationInterval

func (x *Generation) GetGenerationInterval() *durationpb.Duration

func (*Generation) GetIncludeDeprecated

func (x *Generation) GetIncludeDeprecated() bool

func (*Generation) GetIncludeDescriptions

func (x *Generation) GetIncludeDescriptions() bool

func (*Generation) GetIncludeExamples

func (x *Generation) GetIncludeExamples() bool

func (*Generation) GetIncludeExternalDocs

func (x *Generation) GetIncludeExternalDocs() bool

func (*Generation) GetIncludeRequestSchemas

func (x *Generation) GetIncludeRequestSchemas() bool

func (*Generation) GetIncludeResponseSchemas

func (x *Generation) GetIncludeResponseSchemas() bool

func (*Generation) GetIncludeSecurityDefinitions

func (x *Generation) GetIncludeSecurityDefinitions() bool

func (*Generation) GetIncludeTags

func (x *Generation) GetIncludeTags() bool

func (*Generation) GetOutputFormat

func (x *Generation) GetOutputFormat() string

func (*Generation) GetOutputPath

func (x *Generation) GetOutputPath() string

func (*Generation) ProtoMessage

func (*Generation) ProtoMessage()

func (*Generation) ProtoReflect

func (x *Generation) ProtoReflect() protoreflect.Message

func (*Generation) Reset

func (x *Generation) Reset()

func (*Generation) String

func (x *Generation) String() string

type JWT

type JWT struct {

	// Enable JWT
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// JWT description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// JWT name
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// JWT in (header, query, cookie)
	In string `protobuf:"bytes,4,opt,name=in,proto3" json:"in,omitempty"`
	// contains filtered or unexported fields
}

JWT configuration

func (*JWT) Descriptor deprecated

func (*JWT) Descriptor() ([]byte, []int)

Deprecated: Use JWT.ProtoReflect.Descriptor instead.

func (*JWT) GetDescription

func (x *JWT) GetDescription() string

func (*JWT) GetEnable

func (x *JWT) GetEnable() bool

func (*JWT) GetIn

func (x *JWT) GetIn() string

func (*JWT) GetName

func (x *JWT) GetName() string

func (*JWT) ProtoMessage

func (*JWT) ProtoMessage()

func (*JWT) ProtoReflect

func (x *JWT) ProtoReflect() protoreflect.Message

func (*JWT) Reset

func (x *JWT) Reset()

func (*JWT) String

func (x *JWT) String() string

type License

type License struct {

	// License name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// License URL
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

License information

func (*License) Descriptor deprecated

func (*License) Descriptor() ([]byte, []int)

Deprecated: Use License.ProtoReflect.Descriptor instead.

func (*License) GetName

func (x *License) GetName() string

func (*License) GetUrl

func (x *License) GetUrl() string

func (*License) ProtoMessage

func (*License) ProtoMessage()

func (*License) ProtoReflect

func (x *License) ProtoReflect() protoreflect.Message

func (*License) Reset

func (x *License) Reset()

func (*License) String

func (x *License) String() string

type OAuth2

type OAuth2 struct {

	// Client ID
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// Client secret
	ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
	// Realm
	Realm string `protobuf:"bytes,3,opt,name=realm,proto3" json:"realm,omitempty"`
	// App name
	AppName string `protobuf:"bytes,4,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	// Scopes
	Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// Use basic authentication
	UseBasicAuthentication bool `` /* 130-byte string literal not displayed */
	// Use password flow
	UsePasswordFlow bool `protobuf:"varint,7,opt,name=use_password_flow,json=usePasswordFlow,proto3" json:"use_password_flow,omitempty"`
	// Use implicit flow
	UseImplicitFlow bool `protobuf:"varint,8,opt,name=use_implicit_flow,json=useImplicitFlow,proto3" json:"use_implicit_flow,omitempty"`
	// Use access code flow
	UseAccessCodeFlow bool `protobuf:"varint,9,opt,name=use_access_code_flow,json=useAccessCodeFlow,proto3" json:"use_access_code_flow,omitempty"`
	// contains filtered or unexported fields
}

OAuth2 configuration for Swagger UI

func (*OAuth2) Descriptor deprecated

func (*OAuth2) Descriptor() ([]byte, []int)

Deprecated: Use OAuth2.ProtoReflect.Descriptor instead.

func (*OAuth2) GetAppName

func (x *OAuth2) GetAppName() string

func (*OAuth2) GetClientId

func (x *OAuth2) GetClientId() string

func (*OAuth2) GetClientSecret

func (x *OAuth2) GetClientSecret() string

func (*OAuth2) GetRealm

func (x *OAuth2) GetRealm() string

func (*OAuth2) GetScopes

func (x *OAuth2) GetScopes() []string

func (*OAuth2) GetUseAccessCodeFlow

func (x *OAuth2) GetUseAccessCodeFlow() bool

func (*OAuth2) GetUseBasicAuthentication

func (x *OAuth2) GetUseBasicAuthentication() bool

func (*OAuth2) GetUseImplicitFlow

func (x *OAuth2) GetUseImplicitFlow() bool

func (*OAuth2) GetUsePasswordFlow

func (x *OAuth2) GetUsePasswordFlow() bool

func (*OAuth2) ProtoMessage

func (*OAuth2) ProtoMessage()

func (*OAuth2) ProtoReflect

func (x *OAuth2) ProtoReflect() protoreflect.Message

func (*OAuth2) Reset

func (x *OAuth2) Reset()

func (*OAuth2) String

func (x *OAuth2) String() string

type OAuth2Config

type OAuth2Config struct {

	// Enable OAuth2
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// OAuth2 description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// OAuth2 flow
	Flow string `protobuf:"bytes,3,opt,name=flow,proto3" json:"flow,omitempty"`
	// OAuth2 authorization URL
	AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"`
	// OAuth2 token URL
	TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
	// OAuth2 scopes
	Scopes map[string]string `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

OAuth2 configuration for security

func (*OAuth2Config) Descriptor deprecated

func (*OAuth2Config) Descriptor() ([]byte, []int)

Deprecated: Use OAuth2Config.ProtoReflect.Descriptor instead.

func (*OAuth2Config) GetAuthorizationUrl

func (x *OAuth2Config) GetAuthorizationUrl() string

func (*OAuth2Config) GetDescription

func (x *OAuth2Config) GetDescription() string

func (*OAuth2Config) GetEnable

func (x *OAuth2Config) GetEnable() bool

func (*OAuth2Config) GetFlow

func (x *OAuth2Config) GetFlow() string

func (*OAuth2Config) GetScopes

func (x *OAuth2Config) GetScopes() map[string]string

func (*OAuth2Config) GetTokenUrl

func (x *OAuth2Config) GetTokenUrl() string

func (*OAuth2Config) ProtoMessage

func (*OAuth2Config) ProtoMessage()

func (*OAuth2Config) ProtoReflect

func (x *OAuth2Config) ProtoReflect() protoreflect.Message

func (*OAuth2Config) Reset

func (x *OAuth2Config) Reset()

func (*OAuth2Config) String

func (x *OAuth2Config) String() string

type Security

type Security struct {

	// Enable security
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// Security definitions
	Definitions []*SecurityDefinition `protobuf:"bytes,2,rep,name=definitions,proto3" json:"definitions,omitempty"`
	// Global security requirements
	GlobalRequirements []*SecurityRequirement `protobuf:"bytes,3,rep,name=global_requirements,json=globalRequirements,proto3" json:"global_requirements,omitempty"`
	// API key configuration
	ApiKey *APIKey `protobuf:"bytes,4,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"`
	// Basic authentication
	BasicAuth *BasicAuth `protobuf:"bytes,5,opt,name=basic_auth,json=basicAuth,proto3" json:"basic_auth,omitempty"`
	// OAuth2 configuration
	Oauth2Config *OAuth2Config `protobuf:"bytes,6,opt,name=oauth2_config,json=oauth2Config,proto3" json:"oauth2_config,omitempty"`
	// JWT configuration
	Jwt *JWT `protobuf:"bytes,7,opt,name=jwt,proto3" json:"jwt,omitempty"`
	// contains filtered or unexported fields
}

Security configuration

func (*Security) Descriptor deprecated

func (*Security) Descriptor() ([]byte, []int)

Deprecated: Use Security.ProtoReflect.Descriptor instead.

func (*Security) GetApiKey

func (x *Security) GetApiKey() *APIKey

func (*Security) GetBasicAuth

func (x *Security) GetBasicAuth() *BasicAuth

func (*Security) GetDefinitions

func (x *Security) GetDefinitions() []*SecurityDefinition

func (*Security) GetEnable

func (x *Security) GetEnable() bool

func (*Security) GetGlobalRequirements

func (x *Security) GetGlobalRequirements() []*SecurityRequirement

func (*Security) GetJwt

func (x *Security) GetJwt() *JWT

func (*Security) GetOauth2Config

func (x *Security) GetOauth2Config() *OAuth2Config

func (*Security) ProtoMessage

func (*Security) ProtoMessage()

func (*Security) ProtoReflect

func (x *Security) ProtoReflect() protoreflect.Message

func (*Security) Reset

func (x *Security) Reset()

func (*Security) String

func (x *Security) String() string

type SecurityDefinition

type SecurityDefinition struct {

	// Security definition name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Security definition type
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// Security definition description
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Security definition in (header, query, cookie)
	In string `protobuf:"bytes,4,opt,name=in,proto3" json:"in,omitempty"`
	// Security definition name
	NameIn string `protobuf:"bytes,5,opt,name=name_in,json=nameIn,proto3" json:"name_in,omitempty"`
	// Security definition flow
	Flow string `protobuf:"bytes,6,opt,name=flow,proto3" json:"flow,omitempty"`
	// Security definition authorization URL
	AuthorizationUrl string `protobuf:"bytes,7,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"`
	// Security definition token URL
	TokenUrl string `protobuf:"bytes,8,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
	// Security definition scopes
	Scopes map[string]string `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

Security definition

func (*SecurityDefinition) Descriptor deprecated

func (*SecurityDefinition) Descriptor() ([]byte, []int)

Deprecated: Use SecurityDefinition.ProtoReflect.Descriptor instead.

func (*SecurityDefinition) GetAuthorizationUrl

func (x *SecurityDefinition) GetAuthorizationUrl() string

func (*SecurityDefinition) GetDescription

func (x *SecurityDefinition) GetDescription() string

func (*SecurityDefinition) GetFlow

func (x *SecurityDefinition) GetFlow() string

func (*SecurityDefinition) GetIn

func (x *SecurityDefinition) GetIn() string

func (*SecurityDefinition) GetName

func (x *SecurityDefinition) GetName() string

func (*SecurityDefinition) GetNameIn

func (x *SecurityDefinition) GetNameIn() string

func (*SecurityDefinition) GetScopes

func (x *SecurityDefinition) GetScopes() map[string]string

func (*SecurityDefinition) GetTokenUrl

func (x *SecurityDefinition) GetTokenUrl() string

func (*SecurityDefinition) GetType

func (x *SecurityDefinition) GetType() string

func (*SecurityDefinition) ProtoMessage

func (*SecurityDefinition) ProtoMessage()

func (*SecurityDefinition) ProtoReflect

func (x *SecurityDefinition) ProtoReflect() protoreflect.Message

func (*SecurityDefinition) Reset

func (x *SecurityDefinition) Reset()

func (*SecurityDefinition) String

func (x *SecurityDefinition) String() string

type SecurityRequirement

type SecurityRequirement struct {

	// Security requirement name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Security requirement scopes
	Scopes []string `protobuf:"bytes,2,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// contains filtered or unexported fields
}

Security requirement

func (*SecurityRequirement) Descriptor deprecated

func (*SecurityRequirement) Descriptor() ([]byte, []int)

Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead.

func (*SecurityRequirement) GetName

func (x *SecurityRequirement) GetName() string

func (*SecurityRequirement) GetScopes

func (x *SecurityRequirement) GetScopes() []string

func (*SecurityRequirement) ProtoMessage

func (*SecurityRequirement) ProtoMessage()

func (*SecurityRequirement) ProtoReflect

func (x *SecurityRequirement) ProtoReflect() protoreflect.Message

func (*SecurityRequirement) Reset

func (x *SecurityRequirement) Reset()

func (*SecurityRequirement) String

func (x *SecurityRequirement) String() string

type Server

type Server struct {

	// Server URL
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Server description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// Server variables
	Variables []*ServerVariable `protobuf:"bytes,3,rep,name=variables,proto3" json:"variables,omitempty"`
	// contains filtered or unexported fields
}

Server configuration

func (*Server) Descriptor deprecated

func (*Server) Descriptor() ([]byte, []int)

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetDescription

func (x *Server) GetDescription() string

func (*Server) GetUrl

func (x *Server) GetUrl() string

func (*Server) GetVariables

func (x *Server) GetVariables() []*ServerVariable

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) ProtoReflect

func (x *Server) ProtoReflect() protoreflect.Message

func (*Server) Reset

func (x *Server) Reset()

func (*Server) String

func (x *Server) String() string

type ServerVariable

type ServerVariable struct {

	// Variable name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Variable default value
	DefaultValue string `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
	// Variable description
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Variable enum values
	EnumValues []string `protobuf:"bytes,4,rep,name=enum_values,json=enumValues,proto3" json:"enum_values,omitempty"`
	// contains filtered or unexported fields
}

Server variable

func (*ServerVariable) Descriptor deprecated

func (*ServerVariable) Descriptor() ([]byte, []int)

Deprecated: Use ServerVariable.ProtoReflect.Descriptor instead.

func (*ServerVariable) GetDefaultValue

func (x *ServerVariable) GetDefaultValue() string

func (*ServerVariable) GetDescription

func (x *ServerVariable) GetDescription() string

func (*ServerVariable) GetEnumValues

func (x *ServerVariable) GetEnumValues() []string

func (*ServerVariable) GetName

func (x *ServerVariable) GetName() string

func (*ServerVariable) ProtoMessage

func (*ServerVariable) ProtoMessage()

func (*ServerVariable) ProtoReflect

func (x *ServerVariable) ProtoReflect() protoreflect.Message

func (*ServerVariable) Reset

func (x *ServerVariable) Reset()

func (*ServerVariable) String

func (x *ServerVariable) String() string

type Swagger

type Swagger struct {

	// Enable Swagger documentation
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// Swagger UI configuration
	Ui *UI `protobuf:"bytes,2,opt,name=ui,proto3" json:"ui,omitempty"`
	// API documentation configuration
	Api *API `protobuf:"bytes,3,opt,name=api,proto3" json:"api,omitempty"`
	// Security configuration
	Security *Security `protobuf:"bytes,4,opt,name=security,proto3" json:"security,omitempty"`
	// Server configuration
	Server *Server `protobuf:"bytes,5,opt,name=server,proto3" json:"server,omitempty"`
	// Documentation generation configuration
	Generation *Generation `protobuf:"bytes,6,opt,name=generation,proto3" json:"generation,omitempty"`
	// Custom configuration
	Custom *Custom `protobuf:"bytes,7,opt,name=custom,proto3" json:"custom,omitempty"`
	// contains filtered or unexported fields
}

Swagger configuration

func (*Swagger) Descriptor deprecated

func (*Swagger) Descriptor() ([]byte, []int)

Deprecated: Use Swagger.ProtoReflect.Descriptor instead.

func (*Swagger) GetApi

func (x *Swagger) GetApi() *API

func (*Swagger) GetCustom

func (x *Swagger) GetCustom() *Custom

func (*Swagger) GetEnable

func (x *Swagger) GetEnable() bool

func (*Swagger) GetGeneration

func (x *Swagger) GetGeneration() *Generation

func (*Swagger) GetSecurity

func (x *Swagger) GetSecurity() *Security

func (*Swagger) GetServer

func (x *Swagger) GetServer() *Server

func (*Swagger) GetUi

func (x *Swagger) GetUi() *UI

func (*Swagger) ProtoMessage

func (*Swagger) ProtoMessage()

func (*Swagger) ProtoReflect

func (x *Swagger) ProtoReflect() protoreflect.Message

func (*Swagger) Reset

func (x *Swagger) Reset()

func (*Swagger) String

func (x *Swagger) String() string

type Tag

type Tag struct {

	// Tag name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Tag description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// Tag external docs
	ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
	// contains filtered or unexported fields
}

API tag information

func (*Tag) Descriptor deprecated

func (*Tag) Descriptor() ([]byte, []int)

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetDescription

func (x *Tag) GetDescription() string

func (*Tag) GetExternalDocs

func (x *Tag) GetExternalDocs() *ExternalDocs

func (*Tag) GetName

func (x *Tag) GetName() string

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

func (x *Tag) ProtoReflect() protoreflect.Message

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type UI

type UI struct {

	// Enable Swagger UI
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// UI path (default: /swagger)
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// UI title
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// UI description
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	// UI version
	Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
	// UI theme (default, dark, light)
	Theme string `protobuf:"bytes,6,opt,name=theme,proto3" json:"theme,omitempty"`
	// Enable deep linking
	DeepLinking bool `protobuf:"varint,7,opt,name=deep_linking,json=deepLinking,proto3" json:"deep_linking,omitempty"`
	// Enable syntax highlighting
	SyntaxHighlighting bool `protobuf:"varint,8,opt,name=syntax_highlighting,json=syntaxHighlighting,proto3" json:"syntax_highlighting,omitempty"`
	// Enable try it out feature
	TryItOutEnabled bool `protobuf:"varint,9,opt,name=try_it_out_enabled,json=tryItOutEnabled,proto3" json:"try_it_out_enabled,omitempty"`
	// Enable request interceptor
	RequestInterceptor bool `protobuf:"varint,10,opt,name=request_interceptor,json=requestInterceptor,proto3" json:"request_interceptor,omitempty"`
	// Enable response interceptor
	ResponseInterceptor bool `protobuf:"varint,11,opt,name=response_interceptor,json=responseInterceptor,proto3" json:"response_interceptor,omitempty"`
	// Custom CSS URL
	CustomCssUrl string `protobuf:"bytes,12,opt,name=custom_css_url,json=customCssUrl,proto3" json:"custom_css_url,omitempty"`
	// Custom JS URL
	CustomJsUrl string `protobuf:"bytes,13,opt,name=custom_js_url,json=customJsUrl,proto3" json:"custom_js_url,omitempty"`
	// OAuth2 configuration
	Oauth2 *OAuth2 `protobuf:"bytes,14,opt,name=oauth2,proto3" json:"oauth2,omitempty"`
	// contains filtered or unexported fields
}

Swagger UI configuration

func (*UI) Descriptor deprecated

func (*UI) Descriptor() ([]byte, []int)

Deprecated: Use UI.ProtoReflect.Descriptor instead.

func (*UI) GetCustomCssUrl

func (x *UI) GetCustomCssUrl() string

func (*UI) GetCustomJsUrl

func (x *UI) GetCustomJsUrl() string

func (*UI) GetDeepLinking

func (x *UI) GetDeepLinking() bool

func (*UI) GetDescription

func (x *UI) GetDescription() string

func (*UI) GetEnable

func (x *UI) GetEnable() bool

func (*UI) GetOauth2

func (x *UI) GetOauth2() *OAuth2

func (*UI) GetPath

func (x *UI) GetPath() string

func (*UI) GetRequestInterceptor

func (x *UI) GetRequestInterceptor() bool

func (*UI) GetResponseInterceptor

func (x *UI) GetResponseInterceptor() bool

func (*UI) GetSyntaxHighlighting

func (x *UI) GetSyntaxHighlighting() bool

func (*UI) GetTheme

func (x *UI) GetTheme() string

func (*UI) GetTitle

func (x *UI) GetTitle() string

func (*UI) GetTryItOutEnabled

func (x *UI) GetTryItOutEnabled() bool

func (*UI) GetVersion

func (x *UI) GetVersion() string

func (*UI) ProtoMessage

func (*UI) ProtoMessage()

func (*UI) ProtoReflect

func (x *UI) ProtoReflect() protoreflect.Message

func (*UI) Reset

func (x *UI) Reset()

func (*UI) String

func (x *UI) String() string

Jump to

Keyboard shortcuts

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