swagger

package
v0.0.0-...-8813fe1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(swagger *Swagger)

func Contact

func Contact(Contact *openapi3.Contact) Option

func Description

func Description(description string) Option

func DocsUrl

func DocsUrl(url string) Option

func License

func License(License *openapi3.License) Option

func OpenAPIUrl

func OpenAPIUrl(url string) Option

func RedocEnable

func RedocEnable(enable bool) Option

func RedocOptions

func RedocOptions(options map[string]interface{}) Option

func RedocUrl

func RedocUrl(url string) Option

func Servers

func Servers(servers openapi3.Servers) Option

func SwaggerEnable

func SwaggerEnable(enable bool) Option

func SwaggerOptions

func SwaggerOptions(options map[string]interface{}) Option

func TermsOfService

func TermsOfService(TermsOfService string) Option

func Title

func Title(title string) Option

func Version

func Version(version string) Option

type Swagger

type Swagger struct {
	Title          string
	Description    string
	Version        string
	DocsUrl        string
	RedocUrl       string
	OpenAPIUrl     string
	Routers        map[string]map[string]*router.Router
	Servers        openapi3.Servers
	TermsOfService string
	Contact        *openapi3.Contact
	License        *openapi3.License
	OpenAPI        *openapi3.T
	SwaggerEnable  bool
	RedocEnable    bool
	SwaggerOptions map[string]interface{}
	RedocOptions   map[string]interface{}
}

func New

func New(title, description, version string, options ...Option) *Swagger

func (*Swagger) BuildOpenAPI

func (swagger *Swagger) BuildOpenAPI()

func (*Swagger) MarshalJSON

func (swagger *Swagger) MarshalJSON() ([]byte, error)

func (*Swagger) WithContact

func (swagger *Swagger) WithContact(contact *openapi3.Contact) *Swagger

func (*Swagger) WithDescription

func (swagger *Swagger) WithDescription(description string) *Swagger

func (*Swagger) WithDocsUrl

func (swagger *Swagger) WithDocsUrl(url string) *Swagger

func (*Swagger) WithLicense

func (swagger *Swagger) WithLicense(license *openapi3.License) *Swagger

func (*Swagger) WithOpenAPIUrl

func (swagger *Swagger) WithOpenAPIUrl(url string) *Swagger

func (*Swagger) WithRedocOptions

func (swagger *Swagger) WithRedocOptions(options map[string]interface{}) *Swagger

func (*Swagger) WithRedocUrl

func (swagger *Swagger) WithRedocUrl(url string) *Swagger

func (*Swagger) WithServers

func (swagger *Swagger) WithServers(servers []*openapi3.Server) *Swagger

func (*Swagger) WithSwaggerOptions

func (swagger *Swagger) WithSwaggerOptions(options map[string]interface{}) *Swagger

func (*Swagger) WithTermsOfService

func (swagger *Swagger) WithTermsOfService(termsOfService string) *Swagger

func (*Swagger) WithTitle

func (swagger *Swagger) WithTitle(title string) *Swagger

func (*Swagger) WithVersion

func (swagger *Swagger) WithVersion(version string) *Swagger

Jump to

Keyboard shortcuts

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