test

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 404-byte string literal not displayed */

Variables

View Source
var LogError = func(err error) {
	log.Println(fmt.Sprintf("Error: %v", err))
}

Functions

func SchemaPath

func SchemaPath(r *http.Request) (string, bool)

func SpecFileHandler

func SpecFileHandler() http.Handler

Types

type API

type API struct {
	PostPetsHandler PostPetsHandlerFunc

	// not found
	NotFoundHandler http.Handler
	// spec file
	SpecFileHandler http.Handler

	Middlewares []func(h http.Handler) http.Handler
}

func (*API) ServeHTTP

func (rt *API) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type ErrParseParam

type ErrParseParam struct {
	In        string
	Parameter string
	Reason    string
	Err       error
}

func (ErrParseParam) Error

func (e ErrParseParam) Error() string

func (ErrParseParam) Unwrap

func (e ErrParseParam) Unwrap() error

type NewPet

type NewPet struct {
	Name string `json:"name"`
	Tag  string `json:"tag"`
}

type PostPetsHandlerFunc

type PostPetsHandlerFunc func(r PostPetsRequester) PostPetsResponder

func (PostPetsHandlerFunc) ServeHTTP

func (f PostPetsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PostPetsRequest

type PostPetsRequest struct {
	HTTPRequest *http.Request

	Body NewPet
}

type PostPetsRequester

type PostPetsRequester interface {
	Parse() (PostPetsRequest, error)
}

type PostPetsResponder

type PostPetsResponder interface {
	// contains filtered or unexported methods
}

func PostPetsResponse201

func PostPetsResponse201() PostPetsResponder

func PostPetsResponseDefault

func PostPetsResponseDefault(code int) PostPetsResponder

Jump to

Keyboard shortcuts

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