swag

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnSupportMethod  = errors.New("unsupport method")
	ErrUnSupportContent = errors.New("unsupport content type")
)

Functions

This section is empty.

Types

type API

type API struct {
	OperationId string            `json:"operation_id"`
	Server      string            `json:"server"`
	Url         string            `json:"url"`
	Desc        string            `json:"desc"`
	Method      string            `json:"method"`
	ContentType string            `json:"content_type"`
	Query       map[string]string `json:"query"`
	Path        map[string]string `json:"path"`
	Body        map[string]string `json:"body"`
	Header      map[string]string `json:"header"`
	Params      map[string]string `json:"params"`
	Files       map[string]string `json:"files"`
	Requires    []string          `json:"requires"`
}

func Parse

func Parse(_ context.Context, content []byte) ([]*API, error)

func (*API) GetRequest

func (api *API) GetRequest(ctx context.Context) (string, error)

func (*API) ParseParam

func (api *API) ParseParam(ctx context.Context, m map[string]string) error

func (*API) PostRequest

func (api *API) PostRequest(ctx context.Context) (string, error)

func (*API) Request

func (api *API) Request(ctx context.Context, m map[string]string) (string, error)

Jump to

Keyboard shortcuts

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