docs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default       = "default"
	Binding       = "binding"
	Json          = "json"
	DefaultStatus = "default_status"
	Errors        = "errors"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Docs

type Docs struct {
	OpenAPIPath     string
	OpenAPI         *openapi3.T
	OpenAPIUrl      string
	Title           string
	TermsOfService  string
	Description     string
	License         *openapi3.License
	Contact         *openapi3.Contact
	Version         string
	OpenAPIFilePath string
	InMemory        bool
	CORS            *cors.Config
}

func (*Docs) AddParamToOperation

func (d *Docs) AddParamToOperation(paramName string, paramType reflect.Type, operation *openapi3.Operation)

func (*Docs) AddParametersToOperation

func (d *Docs) AddParametersToOperation(params openapi3.Parameters, operation *openapi3.Operation)

func (*Docs) AddServer

func (d *Docs) AddServer(addr string)

func (*Docs) Build

func (d *Docs) Build() error

func (*Docs) CORSConfig

func (d *Docs) CORSConfig() *cors.Config

func (*Docs) ConvertModelToRequestBody

func (d *Docs) ConvertModelToRequestBody(model interface{}, contentType string) *openapi3.RequestBodyRef

func (*Docs) ConvertTypeToInterface

func (d *Docs) ConvertTypeToInterface(t reflect.Type) interface{}

func (*Docs) CreateResponses

func (d *Docs) CreateResponses(model interface{}, errorModel interface{}) openapi3.Responses

func (*Docs) FixPath

func (d *Docs) FixPath(path string) string

func (*Docs) NewOpenAPI

func (d *Docs) NewOpenAPI()

func (*Docs) OpenAPIContent

func (d *Docs) OpenAPIContent() *openapi3.T

func (*Docs) ParseQueryParams

func (d *Docs) ParseQueryParams(queryModel interface{}) openapi3.Parameters

func (*Docs) PathItem

func (d *Docs) PathItem(path string) *openapi3.PathItem

func (*Docs) PathTags

func (d *Docs) PathTags(path string) []string

func (*Docs) PathsIsEmpty

func (d *Docs) PathsIsEmpty() bool

func (*Docs) ResponseDefaultStatus

func (d *Docs) ResponseDefaultStatus(model interface{}) int

func (*Docs) SetOperationOnPath

func (d *Docs) SetOperationOnPath(path string, method string, operation openapi3.Operation)

func (*Docs) SetPathItem

func (d *Docs) SetPathItem(path string, pathItem *openapi3.PathItem)

func (*Docs) Valid

func (d *Docs) Valid() error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(docs *Docs) *Handler

func (*Handler) Docs

func (h *Handler) Docs(ctx *gin.Context)

func (*Handler) File

func (h *Handler) File(ctx *gin.Context)

type PathDoc

type PathDoc openapi3.Operation

Jump to

Keyboard shortcuts

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