httpapi

package
v0.0.0-...-7625c6f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {
	Name string

	InputBody analysis.Type

	// Return may be nil
	Return analysis.Type

	InputForm        Form
	InputQueryParams []TypedParam

	IsReturnBlob bool // Return is a []byte, interpreted as a file
	// contains filtered or unexported fields
}

Contract describes the expected and returned types for one endpoint.

type Endpoint

type Endpoint struct {
	Url      string
	Method   string
	Contract Contract
}

Endpoint describes one server endpoint

func ParseEcho

func ParseEcho(pkg *packages.Package, absFilePath string) []Endpoint

ParseEcho scans a file using the Echo framework.

type Form

type Form struct {
	File       string // empty means no file
	ValueNames []string
}

func (Form) AsTypedValues

func (f Form) AsTypedValues() []TypedParam

AsTypedValues returns the name of the form parameters with type String

func (Form) IsZero

func (f Form) IsZero() bool

type TypedParam

type TypedParam struct {
	Type *analysis.Basic
	Name string
	// contains filtered or unexported fields
}

Directories

Path Synopsis
echo
Package echo is a substitute for the http framework echo package.
Package echo is a substitute for the http framework echo package.
inner
Package inner is only used to test apigen.
Package inner is only used to test apigen.

Jump to

Keyboard shortcuts

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