router

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindModel

func BindModel(api IAPI) gin.HandlerFunc

Types

type IAPI

type IAPI interface {
	Handler(context *gin.Context)
}

type Option

type Option func(router *Router)

func ContentType

func ContentType(contentType string) Option

ContentType Set request contentType

func Deprecated

func Deprecated() Option

Deprecated mark api is deprecated

func Description

func Description(description string) Option

func Exclude

func Exclude() Option

Exclude exclude in docs

func Handlers

func Handlers(handlers ...gin.HandlerFunc) Option

func OperationID

func OperationID(ID string) Option

func Responses

func Responses(response Response) Option

func Security

func Security(securities ...security.ISecurity) Option

func Summary

func Summary(summary string) Option

func Tags

func Tags(tags ...string) Option

type Response

type Response map[string]ResponseItem

type ResponseItem

type ResponseItem struct {
	Description string
	Model       interface{}
	Headers     openapi3.Headers
}

type Router

type Router struct {
	Handlers    *list.List
	Path        string
	Method      string
	Summary     string
	Description string
	Deprecated  bool
	ContentType string
	Tags        []string
	API         IAPI
	OperationID string
	Exclude     bool
	Securities  []security.ISecurity
	Response    Response
}

func New

func New(api IAPI, options ...Option) *Router

func (*Router) GetHandlers

func (router *Router) GetHandlers() []gin.HandlerFunc

Jump to

Keyboard shortcuts

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