swagger

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT     = "default"
	BINDING     = "binding"
	DESCRIPTION = "description"
	QUERY       = "query"
	FORM        = "form"
	URI         = "uri"
	HEADER      = "header"
	COOKIE      = "cookie"
)

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 RedocOptions

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

func RedocUrl

func RedocUrl(url string) Option

func Routers

func Routers(routers map[string]map[string]*router.Router) Option

func Servers

func Servers(servers openapi3.Servers) 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
	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)

Jump to

Keyboard shortcuts

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