test

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 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(ctx context.Context, r GetPetsPetIDNamesRequest) GetPetsPetIDNamesResponse

func (GetPetsPetIDNamesHandlerFunc) ServeHTTP

type GetPetsPetIDNamesParams added in v0.0.3

type GetPetsPetIDNamesParams struct {
	Path GetPetsPetIDNamesParamsPath
}

func (GetPetsPetIDNamesParams) HTTP added in v0.0.3

func (GetPetsPetIDNamesParams) Parse added in v0.0.3

type GetPetsPetIDNamesParamsPath added in v0.1.18

type GetPetsPetIDNamesParamsPath struct {
	PetID string
}

type GetPetsPetIDNamesRequest

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

func GetPetsPetIDNamesHTTPRequest

func GetPetsPetIDNamesHTTPRequest(r *http.Request) GetPetsPetIDNamesRequest

type GetPetsPetIDNamesResponse

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

func NewGetPetsPetIDNamesResponse200

func NewGetPetsPetIDNamesResponse200() GetPetsPetIDNamesResponse

type GetPetsPetIDNamesResponse200

type GetPetsPetIDNamesResponse200 struct{}

func (GetPetsPetIDNamesResponse200) Write

type GetPetsPetIDShopsHandlerFunc

type GetPetsPetIDShopsHandlerFunc func(ctx context.Context, r GetPetsPetIDShopsRequest) GetPetsPetIDShopsResponse

func (GetPetsPetIDShopsHandlerFunc) ServeHTTP

type GetPetsPetIDShopsParams added in v0.0.3

type GetPetsPetIDShopsParams struct {
	Path GetPetsPetIDShopsParamsPath
}

func (GetPetsPetIDShopsParams) HTTP added in v0.0.3

func (GetPetsPetIDShopsParams) Parse added in v0.0.3

type GetPetsPetIDShopsParamsPath added in v0.1.18

type GetPetsPetIDShopsParamsPath struct {
	PetID string
}

type GetPetsPetIDShopsRequest

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

func GetPetsPetIDShopsHTTPRequest

func GetPetsPetIDShopsHTTPRequest(r *http.Request) GetPetsPetIDShopsRequest

type GetPetsPetIDShopsResponse

type GetPetsPetIDShopsResponse interface {
	// 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)
}

type HTTPClientFunc added in v0.0.11

type HTTPClientFunc func(*http.Request) (*http.Response, error)

func (HTTPClientFunc) Do added in v0.0.11

type Maybe added in v0.1.5

type Maybe[T any] struct {
	IsSet bool
	Value T
}

func Just added in v0.1.5

func Just[T any](v T) Maybe[T]

func (*Maybe[T]) Set added in v0.1.6

func (m *Maybe[T]) Set(v T)

Jump to

Keyboard shortcuts

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