api_documentation

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillStructSchema added in v1.35.0

func FillStructSchema(docs *Docs, element reflect.Type, elementName string) error

func GetFunctionName added in v1.35.0

func GetFunctionName(temp interface{}) string

func GetResponse added in v1.35.0

func GetResponse(handler handler_utils.Handler) (map[string]DocResponseValue, string)

func GetStructDocs added in v1.35.0

func GetStructDocs(corePath string) map[string]string

func StructFieldName added in v1.35.0

func StructFieldName(structField reflect.StructField) string

func StructSchema added in v1.35.0

func StructSchema(docs *Docs, t reflect.Type) (interface{}, error)

Types

type DocMethodInfo added in v1.35.0

type DocMethodInfo struct {
	Description string                       `json:"description"`
	Summary     string                       `json:"summary"`
	Tags        []string                     `json:"tags"`
	RequestBody *DocRequestBody              `json:"requestBody,omitempty"`
	Parameters  []DocParam                   `json:"parameters,omitempty"`
	Responses   *map[string]DocResponseValue `json:"responses,omitempty"`
}

type DocParam

type DocParam struct {
	Name        string      `json:"name"`
	In          string      `json:"in"`
	Description string      `json:"description"`
	Required    bool        `json:"required,omitempty"`
	Schema      interface{} `json:"schema"`
}

func FillParameters added in v1.35.0

func FillParameters(docs *Docs, handler handler_utils.Handler) ([]DocParam, error)

type DocPath

type DocPath map[string]DocMethodInfo

type DocRequestBody added in v1.35.0

type DocRequestBody struct {
	Description string                 `json:"description"`
	Required    bool                   `json:"required"`
	Content     map[string]interface{} `json:"content"`
}

func GetRequestBody added in v1.35.0

func GetRequestBody(handler handler_utils.Handler, functionDocs map[string]string) (string, DocRequestBody)

type DocResponseValue added in v1.35.0

type DocResponseValue struct {
	Description string                  `json:"description"`
	Content     *map[string]interface{} `json:"content,omitempty"`
}

type DocSchema

type DocSchema struct {
	Ref string `json:"$ref"`
}

type DocSchemaResponse added in v1.35.0

type DocSchemaResponse struct {
	Type  *string   `json:"type,omitempty"`
	Items DocSchema `json:"items"`
}

type DocSchemas added in v1.35.0

type DocSchemas struct {
	Schemas map[string]interface{} `json:"schemas"`
}

type Docs

type Docs struct {
	Paths      map[string]DocPath `json:"paths"`
	Components DocSchemas         `json:"components"`
}

func GetDocs

func GetDocs(endpointHandlers map[string]map[string]interface{}, corePath string) (Docs, error)

type NoParams

type NoParams struct{}

Jump to

Keyboard shortcuts

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