openapi31

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRouter

func AddRouter(path string, method string, input interface{})

AddRouter 添加一个路由

func Init

func Init() *reflector

func IsValid

func IsValid() bool

IsValid 判断 reflector 是否有效 当前只前端是否为 nil

func Output

func Output()

func WithOptions

func WithOptions(opts ...Option)

WithOptions 添加 options

Types

type Option

type Option = func(r *reflector)

func WithDescription

func WithDescription(dest string) Option

WithDescription 设置 openapi info: app description

func WithFile

func WithFile(output string) Option

WithFile 设置保存 openapi 数据的文件。 如果不设置, 将输出到 os.Stdout

func WithTitle

func WithTitle(title string) Option

WithTitle 设置 openapi info: app title

func WithVersion

func WithVersion(version string) Option

WithVersion 设置 openapi info: app version

type RespStructure added in v0.5.2

type RespStructure struct {
	Output any
	Status int
}

type RespStructurer added in v0.5.2

type RespStructurer interface {
	RespStructure() []RespStructure
}

type SecurityStructure added in v0.5.2

type SecurityStructure struct {
	Name  string
	Rules []string
}

type SecurityStructurer added in v0.5.2

type SecurityStructurer interface {
	SecurityStructure() []SecurityStructure
}

Jump to

Keyboard shortcuts

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