test

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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 GetPetsPetIDNamesRequest) (GetPetsPetIDNamesResponse, error)

GetPetsPetIDNames - GET /pets/{pet_id}/names

func (*Client) GetPetsPetIDShops

func (c *Client) GetPetsPetIDShops(ctx context.Context, request GetPetsPetIDShopsRequest) (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 GetPetsPetIDNamesRequestParser) GetPetsPetIDNamesResponse

func (GetPetsPetIDNamesHandlerFunc) ServeHTTP

type GetPetsPetIDNamesRequest

type GetPetsPetIDNamesRequest struct {
	HTTPRequest *http.Request

	Path struct {
		PetID string
	}
}

func (GetPetsPetIDNamesRequest) Parse

type GetPetsPetIDNamesRequestParser

type GetPetsPetIDNamesRequestParser interface {
	Parse() (GetPetsPetIDNamesRequest, error)
}

func GetPetsPetIDNamesHTTPRequest

func GetPetsPetIDNamesHTTPRequest(r *http.Request) GetPetsPetIDNamesRequestParser

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 GetPetsPetIDShopsRequestParser) GetPetsPetIDShopsResponse

func (GetPetsPetIDShopsHandlerFunc) ServeHTTP

type GetPetsPetIDShopsRequest

type GetPetsPetIDShopsRequest struct {
	HTTPRequest *http.Request

	Path struct {
		PetID string
	}
}

func (GetPetsPetIDShopsRequest) Parse

type GetPetsPetIDShopsRequestParser

type GetPetsPetIDShopsRequestParser interface {
	Parse() (GetPetsPetIDShopsRequest, error)
}

func GetPetsPetIDShopsHTTPRequest

func GetPetsPetIDShopsHTTPRequest(r *http.Request) GetPetsPetIDShopsRequestParser

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