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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 1139-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

type Client struct {
	BaseURL    string
	HTTPClient HTTPClient
}

func NewClient

func NewClient(baseURL string, httpClient HTTPClient) *Client

func (*Client) GetShopsShop

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(ctx context.Context, r GetShopsShopRequest) GetShopsShopResponse

func (GetShopsShopHandlerFunc) ServeHTTP

type GetShopsShopParams

type GetShopsShopParams struct {
	Query GetShopsShopParamsQuery

	Path GetShopsShopParamsPath

	Headers GetShopsShopParamsHeaders
}

func (GetShopsShopParams) HTTP

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

func (GetShopsShopParams) Parse

type GetShopsShopParamsHeaders added in v0.1.18

type GetShopsShopParamsHeaders struct {
	RequestID Maybe[RequestID]
}

type GetShopsShopParamsPath added in v0.1.18

type GetShopsShopParamsPath struct {
	Shop Shop
}

type GetShopsShopParamsQuery added in v0.1.18

type GetShopsShopParamsQuery struct {
	Page Maybe[Page]

	PageReq Page

	Pages Maybe[[]Page]

	PageCustom Maybe[PageCustom]
}

type GetShopsShopRequest

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

func GetShopsShopHTTPRequest

func GetShopsShopHTTPRequest(r *http.Request) GetShopsShopRequest

type GetShopsShopResponse

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

func NewGetShopsShopResponse200

func NewGetShopsShopResponse200() GetShopsShopResponse

func NewGetShopsShopResponseDefault

func NewGetShopsShopResponseDefault(code int) GetShopsShopResponse

type GetShopsShopResponse200

type GetShopsShopResponse200 struct{}

func (GetShopsShopResponse200) Write

type GetShopsShopResponseDefault

type GetShopsShopResponseDefault struct {
	Code int
}

func (GetShopsShopResponseDefault) Write

type HTTPClient

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

type HTTPClientFunc

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

func (HTTPClientFunc) Do

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)

type Page added in v0.0.19

type Page int

func (*Page) ParseInt32 added in v0.1.15

func (p *Page) ParseInt32(v int32) error

func (Page) String added in v0.0.19

func (p Page) String() string

func (Page) Strings added in v0.1.4

func (p Page) Strings() []string

type PageCustom added in v0.1.10

type PageCustom = pkg.Page

type RequestID added in v0.0.19

type RequestID string

func (*RequestID) ParseString added in v0.1.15

func (s *RequestID) ParseString(v string) error

func (RequestID) String added in v0.0.19

func (s RequestID) String() string

type Shop added in v0.0.19

type Shop string

func (*Shop) ParseString added in v0.1.15

func (s *Shop) ParseString(v string) error

func (Shop) String added in v0.0.19

func (s Shop) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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