test

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 329-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 {
	GetPetsPetIDNamesHandler GetPetsPetIDNamesHandlerFunc
	GetPetsPetIDShopsHandler GetPetsPetIDShopsHandlerFunc

	// 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 Client

type Client struct {
	BaseURL    string
	HTTPClient HTTPClient
}

func NewClient

func NewClient(baseURL string, httpClient HTTPClient) *Client

func (*Client) GetPetsPetIDNames

func (c *Client) GetPetsPetIDNames(ctx context.Context, request GetPetsPetIDNamesParams) (GetPetsPetIDNamesResponse, error)

GetPetsPetIDNames - GET /pets/{pet_id}/names

func (*Client) GetPetsPetIDShops

func (c *Client) GetPetsPetIDShops(ctx context.Context, request GetPetsPetIDShopsParams) (GetPetsPetIDShopsResponse, error)

GetPetsPetIDShops - GET /pets/{pet_id}/shops

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 GetPetsPetIDNamesHandlerFunc

type GetPetsPetIDNamesHandlerFunc func(r GetPetsPetIDNamesRequest) GetPetsPetIDNamesResponse

func (GetPetsPetIDNamesHandlerFunc) ServeHTTP

type GetPetsPetIDNamesParams added in v0.0.3

type GetPetsPetIDNamesParams struct {
	Path struct {
		PetID string
	}
}

func (GetPetsPetIDNamesParams) HTTP added in v0.0.3

func (GetPetsPetIDNamesParams) Parse added in v0.0.3

type GetPetsPetIDNamesRequest

type GetPetsPetIDNamesRequest interface {
	HTTP() *http.Request
	Parse() (GetPetsPetIDNamesParams, error)
}

func GetPetsPetIDNamesHTTPRequest

func GetPetsPetIDNamesHTTPRequest(r *http.Request) GetPetsPetIDNamesRequest

type GetPetsPetIDNamesResponse

type GetPetsPetIDNamesResponse interface {
	Write(w http.ResponseWriter)
	// contains filtered or unexported methods
}

func NewGetPetsPetIDNamesResponse200

func NewGetPetsPetIDNamesResponse200() GetPetsPetIDNamesResponse

type GetPetsPetIDNamesResponse200

type GetPetsPetIDNamesResponse200 struct{}

func (GetPetsPetIDNamesResponse200) Write

type GetPetsPetIDShopsHandlerFunc

type GetPetsPetIDShopsHandlerFunc func(r GetPetsPetIDShopsRequest) GetPetsPetIDShopsResponse

func (GetPetsPetIDShopsHandlerFunc) ServeHTTP

type GetPetsPetIDShopsParams added in v0.0.3

type GetPetsPetIDShopsParams struct {
	Path struct {
		PetID string
	}
}

func (GetPetsPetIDShopsParams) HTTP added in v0.0.3

func (GetPetsPetIDShopsParams) Parse added in v0.0.3

type GetPetsPetIDShopsRequest

type GetPetsPetIDShopsRequest interface {
	HTTP() *http.Request
	Parse() (GetPetsPetIDShopsParams, error)
}

func GetPetsPetIDShopsHTTPRequest

func GetPetsPetIDShopsHTTPRequest(r *http.Request) GetPetsPetIDShopsRequest

type GetPetsPetIDShopsResponse

type GetPetsPetIDShopsResponse interface {
	Write(w http.ResponseWriter)
	// contains filtered or unexported methods
}

func NewGetPetsPetIDShopsResponse200

func NewGetPetsPetIDShopsResponse200() GetPetsPetIDShopsResponse

type GetPetsPetIDShopsResponse200

type GetPetsPetIDShopsResponse200 struct{}

func (GetPetsPetIDShopsResponse200) Write

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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