amiswagger

package module
v0.0.0-...-ad22658 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

amiswagger

ami swagger package to generate documentation

Documentation

Overview

Package amiswagger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOpenApi

func GenerateOpenApi(params Parameter, listHandler []Handler) (err error)

func PrintJson

func PrintJson(models interface{})

func StructDetail

func StructDetail(str interface{})

Types

type Authorization

type Authorization struct {
	Authorization string `header:"Authorization"`
}

type ErrorData

type ErrorData struct {
	Error   string `json:"error"`
	Message string `json:"message,omitempty"`
}

type Handler

type Handler struct {
	api.Handler
	Summary       string
	Request       interface{}
	Response      []OpenApiResponse
	Authorization *string `json:"authorization"`
}

func NewOpenApiHandler

func NewOpenApiHandler(handler api.Handler, summary string, req interface{}, resp []OpenApiResponse) Handler

type OpenApiResponse

type OpenApiResponse struct {
	Code   int
	Output interface{}
}

type Parameter

type Parameter struct {
	Title       string
	Description string
	Filename    string
	Servers     []openapi3.Server
}

func NewOpenApiParams

func NewOpenApiParams(title string, description string, filename string, servers []openapi3.Server) Parameter

type ResponseData

type ResponseData struct {
	Error   string `json:"error"`
	Message string `json:"message,omitempty"`
}

type ResponseDataList

type ResponseDataList struct {
	Error   string  `json:"error"`
	Message string  `json:"message,omitempty"`
	Total   *uint64 `json:"total,omitempty"`
}

Jump to

Keyboard shortcuts

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