option

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePath

func BasePath(v string) swag.Option

BasePath sets basePath

func ContactEmail

func ContactEmail(v string) swag.Option

ContactEmail sets info.contact.email

func Description

func Description(v string) swag.Option

Description sets info.description

func Endpoints

func Endpoints(endpoints ...*swag.Endpoint) swag.Option

Endpoints allows the endpoints to be added dynamically to the Api

func Host

func Host(v string) swag.Option

Host specifies the host field

func License

func License(name, url string) swag.Option

License sets both info.license.name and info.license.url

func Schemes

func Schemes(v ...string) swag.Option

Schemes sets the scheme

func Security

func Security(scheme string, scopes ...string) swag.Option

Security sets a default security scheme for all endpoints in the API.

func SecurityScheme

func SecurityScheme(name string, options ...SecuritySchemeOption) swag.Option

SecurityScheme creates a new security definition for the API.

func Tag

func Tag(name, description string, options ...TagOption) swag.Option

Tag adds a tag to the swagger api

func TermsOfService

func TermsOfService(v string) swag.Option

TermsOfService sets info.termsOfService

func Title

func Title(v string) swag.Option

Title sets info.title

func Version

func Version(v string) swag.Option

Version sets info.version

Types

type SecuritySchemeOption

type SecuritySchemeOption func(securityScheme *swag.SecurityScheme)

SecuritySchemeOption provides additional customizations to the SecurityScheme.

func APIKeySecurity

func APIKeySecurity(name, in string) SecuritySchemeOption

APIKeySecurity defines a security scheme for API key authentication. "in" is the location of the API key (query or header). "name" is the name of the header or query parameter to be used.

func BasicSecurity

func BasicSecurity() SecuritySchemeOption

BasicSecurity defines a security scheme for HTTP Basic authentication.

func BearerAuth

func BearerAuth(name, in string) SecuritySchemeOption

BearerAuth defines a security scheme for Bearer authentication. "in" is the location of the token (query or header). "name" is the name of the header or query parameter to be used.

func OAuth2Scope

func OAuth2Scope(scope, description string) SecuritySchemeOption

OAuth2Scope adds a new scope to the security scheme.

func OAuth2Security

func OAuth2Security(flow, authorizationURL, tokenURL string) SecuritySchemeOption

OAuth2Security defines a security scheme for OAuth2 authentication. Flow can be one of implicit, password, application, or accessCode.

func SecuritySchemeDescription

func SecuritySchemeDescription(description string) SecuritySchemeOption

SecuritySchemeDescription sets the security scheme's description.

type TagOption

type TagOption func(tag *swag.Tag)

TagOption provides additional customizations to the #Tag option

func TagDescription

func TagDescription(v string) TagOption

TagDescription sets externalDocs.description on the tag field

func TagURL

func TagURL(v string) TagOption

TagURL sets externalDocs.url on the tag field

Jump to

Keyboard shortcuts

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