wrapper

package
v0.0.0-...-211ac5a Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InBody     = "body"
	InPath     = "path"
	InQuery    = "query"
	InHeader   = "header"
	InFromData = "fromData"

	SecurityBearer = "Bearer"
	SecurityName   = "Authorization"

	TypesJson = "json"
	TypesBson = "bson"
)

Variables

This section is empty.

Functions

func ConvertObjectToSwaggerParameter

func ConvertObjectToSwaggerParameter(params map[string]interface{}, object interface{}, subObj bool) parameters.SwaggParameter

func NewArrayParameterConfig

func NewArrayParameterConfig(in, name, description string, required bool, minItems, maxItems int, uniqueItems bool) structures.Config

func NewBasicParameterConfig

func NewBasicParameterConfig(in, name, description string, required bool) structures.Config

func NewIntegerParameterConfig

func NewIntegerParameterConfig(in, name, description string, required bool, defaultValue, min, max, multipleOf int, exclusiveMin, exclusiveMax bool) structures.Config

func NewMainConfig

func NewMainConfig(version, title, description, host, basePath string) structures.Config

func NewNumberParameterConfig

func NewNumberParameterConfig(in, name, description string, required bool, defaultValue, min, max, multipleOf float64, exclusiveMin, exclusiveMax bool) structures.Config

func NewRequestConfig

func NewRequestConfig(description, operationId, summary string, security, consumes, produces, tags []string) structures.Config

func NewRequiredMainConfig

func NewRequiredMainConfig(version, title string) structures.Config

func NewRequiredParameterConfig

func NewRequiredParameterConfig(in, name string) structures.Config

func NewStringParameterConfig

func NewStringParameterConfig(in, name, description string, required bool, format string, minLength, maxLength int, pattern string, enum []string) structures.Config

func ReturnNonStructureObject

func ReturnNonStructureObject(params map[string]interface{}, object interface{}) parameters.SwaggParameter

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

func NewParameter

func NewParameter(params structures.Config, obj interface{}) Parameter

type Response

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

func NewResponse

func NewResponse(description string, object interface{}) Response

type SwaggerGroupWrapper

type SwaggerGroupWrapper interface {
	Use(middleware ...gin.HandlerFunc)
	Path(path string) SwaggerPathWrapper
	Group(path, tag string) SwaggerGroupWrapper

	GET(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	POST(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	DELETE(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	HEAD(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	OPTIONS(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PATCH(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PUT(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	// contains filtered or unexported methods
}

type SwaggerPathWrapper

type SwaggerPathWrapper interface {
	GET(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	POST(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	DELETE(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	HEAD(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	OPTIONS(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PATCH(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PUT(config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	// contains filtered or unexported methods
}

type SwaggerRouterWrapper

type SwaggerRouterWrapper interface {
	Group(path, tag string) SwaggerGroupWrapper
	Use(middleware ...gin.HandlerFunc)
	GenerateFiles(filepath string) error
	GenerateBasePath(pathUrl string) error

	NewBasicSecurityDefinition(title string)
	NewApiKeySecurityDefinition(title, name string, inHeader bool)
	NewOauth2ImplicitSecurityDefinition(title, authorizationUrl string)
	NewOauth2PasswordSecurityDefinition(title, tokenURL string)
	NewOauth2ApplicationSecurityDefinition(title, tokenURL string)
	NewOauth2AccessCodeSecurityDefinition(title, authorizationUrl, tokenURL string)
	GET(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	POST(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	DELETE(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	HEAD(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	OPTIONS(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PATCH(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	PUT(path string, config structures.Config, parameters []Parameter, requests map[int]Response, handlerFunc ...gin.HandlerFunc)
	// contains filtered or unexported methods
}

func NewSwaggerRouterWrapper

func NewSwaggerRouterWrapper(config structures.Config, r *gin.Engine) SwaggerRouterWrapper

Jump to

Keyboard shortcuts

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