test

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 470-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 {
	GetPetsPetIDHandler GetPetsPetIDHandlerFunc

	// 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) GetPetsPetID

func (c *Client) GetPetsPetID(ctx context.Context, request GetPetsPetIDParams) (GetPetsPetIDResponse, error)

GetPetsPetID - GET /pets/{pet_id}

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 GetPetsPetIDHandlerFunc

type GetPetsPetIDHandlerFunc func(r GetPetsPetIDRequest) GetPetsPetIDResponse

func (GetPetsPetIDHandlerFunc) ServeHTTP

type GetPetsPetIDParams added in v0.0.3

type GetPetsPetIDParams struct {
	Path struct {
		PetID int32
	}
}

func (GetPetsPetIDParams) HTTP added in v0.0.3

func (r GetPetsPetIDParams) HTTP() *http.Request

func (GetPetsPetIDParams) Parse added in v0.0.3

type GetPetsPetIDRequest

type GetPetsPetIDRequest interface {
	HTTP() *http.Request
	Parse() (GetPetsPetIDParams, error)
}

func GetPetsPetIDHTTPRequest

func GetPetsPetIDHTTPRequest(r *http.Request) GetPetsPetIDRequest

type GetPetsPetIDResponse

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

func NewGetPetsPetIDResponse200JSON

func NewGetPetsPetIDResponse200JSON(body Pet) GetPetsPetIDResponse

type GetPetsPetIDResponse200JSON

type GetPetsPetIDResponse200JSON struct {
	Body Pet
}

func (GetPetsPetIDResponse200JSON) Write

type HTTPClient

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

type Pet

type Pet struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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