test

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 416-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 {
	GetShopsShopHandler GetShopsShopHandlerFunc

	// 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 added in v0.0.2

type Client struct {
	BaseURL    string
	HTTPClient HTTPClient
}

func NewClient added in v0.0.2

func NewClient(baseURL string, httpClient HTTPClient) *Client

func (*Client) GetShopsShop added in v0.0.2

func (c *Client) GetShopsShop(ctx context.Context, request GetShopsShopParams) (GetShopsShopResponse, error)

GetShopsShop - GET /shops/{shop}

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 GetShopsShopHandlerFunc

type GetShopsShopHandlerFunc func(r GetShopsShopRequest) GetShopsShopResponse

func (GetShopsShopHandlerFunc) ServeHTTP

type GetShopsShopParams added in v0.0.3

type GetShopsShopParams struct {
	Query struct {
		Page *int32
	}

	Path struct {
		Shop string
	}

	Headers struct {
		RequestID *string
	}
}

func (GetShopsShopParams) HTTP added in v0.0.3

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

func (GetShopsShopParams) Parse added in v0.0.3

type GetShopsShopRequest

type GetShopsShopRequest interface {
	HTTP() *http.Request
	Parse() (GetShopsShopParams, error)
}

func GetShopsShopHTTPRequest added in v0.0.2

func GetShopsShopHTTPRequest(r *http.Request) GetShopsShopRequest

type GetShopsShopResponse added in v0.0.2

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

func NewGetShopsShopResponse200 added in v0.0.2

func NewGetShopsShopResponse200() GetShopsShopResponse

func NewGetShopsShopResponseDefault added in v0.0.2

func NewGetShopsShopResponseDefault(code int) GetShopsShopResponse

type GetShopsShopResponse200

type GetShopsShopResponse200 struct{}

func (GetShopsShopResponse200) Write added in v0.0.2

type GetShopsShopResponseDefault

type GetShopsShopResponseDefault struct {
	Code int
}

func (GetShopsShopResponseDefault) Write added in v0.0.2

type HTTPClient added in v0.0.2

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