test

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 659-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 {
	PostShopsShopPetsHandler PostShopsShopPetsHandlerFunc

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

func (c *Client) PostShopsShopPets(ctx context.Context, request PostShopsShopPetsParams) (PostShopsShopPetsResponse, error)

PostShopsShopPets - POST /shops/{shop}/pets

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 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 NewPet

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

type PostShopsShopPetsHandlerFunc

type PostShopsShopPetsHandlerFunc func(ctx context.Context, r PostShopsShopPetsRequest) PostShopsShopPetsResponse

func (PostShopsShopPetsHandlerFunc) ServeHTTP

type PostShopsShopPetsParams

type PostShopsShopPetsParams struct {
	Path struct {
		Shop pkg.ShopType
	}

	Body NewPet
}

func (PostShopsShopPetsParams) HTTP

func (PostShopsShopPetsParams) Parse

type PostShopsShopPetsRequest

type PostShopsShopPetsRequest interface {
	HTTP() *http.Request
	Parse() (PostShopsShopPetsParams, error)
}

func PostShopsShopPetsHTTPRequest

func PostShopsShopPetsHTTPRequest(r *http.Request) PostShopsShopPetsRequest

type PostShopsShopPetsResponse

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

func NewPostShopsShopPetsResponse201

func NewPostShopsShopPetsResponse201() PostShopsShopPetsResponse

func NewPostShopsShopPetsResponseDefault

func NewPostShopsShopPetsResponseDefault(code int) PostShopsShopPetsResponse

type PostShopsShopPetsResponse201

type PostShopsShopPetsResponse201 struct{}

func (PostShopsShopPetsResponse201) Write

type PostShopsShopPetsResponseDefault

type PostShopsShopPetsResponseDefault struct {
	Code int
}

func (PostShopsShopPetsResponseDefault) Write

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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