Documentation
¶
Index ¶
- Constants
- Variables
- func SchemaPath(r *http.Request) (string, bool)
- func SpecFileHandler() http.Handler
- type API
- type Client
- type ErrParseParam
- type GetPetsHandlerFunc
- type GetPetsNamesHandlerFunc
- type GetPetsNamesRequest
- type GetPetsNamesRequestParser
- type GetPetsNamesResponse
- type GetPetsNamesResponse200JSON
- type GetPetsRequest
- type GetPetsRequestParser
- type GetPetsResponse
- type GetPetsResponse200JSON
- type HTTPClient
- type Pet
Constants ¶
View Source
const SpecFile string = `` /* 641-byte string literal not displayed */
Variables ¶
Functions ¶
func SpecFileHandler ¶
Types ¶
type API ¶
type API struct {
GetPetsHandler GetPetsHandlerFunc
GetPetsNamesHandler GetPetsNamesHandlerFunc
// not found
NotFoundHandler http.Handler
// spec file
SpecFileHandler http.Handler
Middlewares []func(h http.Handler) http.Handler
}
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) GetPets ¶ added in v0.0.2
func (c *Client) GetPets(ctx context.Context, request GetPetsRequest) (GetPetsResponse, error)
GetPets - GET /pets
func (*Client) GetPetsNames ¶ added in v0.0.2
func (c *Client) GetPetsNames(ctx context.Context, request GetPetsNamesRequest) (GetPetsNamesResponse, error)
GetPetsNames - GET /pets/names
type ErrParseParam ¶
func (ErrParseParam) Error ¶
func (e ErrParseParam) Error() string
func (ErrParseParam) Unwrap ¶
func (e ErrParseParam) Unwrap() error
type GetPetsHandlerFunc ¶
type GetPetsHandlerFunc func(r GetPetsRequestParser) GetPetsResponse
func (GetPetsHandlerFunc) ServeHTTP ¶
func (f GetPetsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetPetsNamesHandlerFunc ¶
type GetPetsNamesHandlerFunc func(r GetPetsNamesRequestParser) GetPetsNamesResponse
func (GetPetsNamesHandlerFunc) ServeHTTP ¶
func (f GetPetsNamesHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetPetsNamesRequest ¶
func (GetPetsNamesRequest) Parse ¶ added in v0.0.2
func (r GetPetsNamesRequest) Parse() GetPetsNamesRequest
type GetPetsNamesRequestParser ¶ added in v0.0.2
type GetPetsNamesRequestParser interface {
Parse() GetPetsNamesRequest
}
func GetPetsNamesHTTPRequest ¶ added in v0.0.2
func GetPetsNamesHTTPRequest(r *http.Request) GetPetsNamesRequestParser
type GetPetsNamesResponse ¶ added in v0.0.2
type GetPetsNamesResponse interface {
Write(w http.ResponseWriter)
// contains filtered or unexported methods
}
func NewGetPetsNamesResponse200JSON ¶ added in v0.0.2
func NewGetPetsNamesResponse200JSON(body []string) GetPetsNamesResponse
type GetPetsNamesResponse200JSON ¶
type GetPetsNamesResponse200JSON struct {
Body []string
}
func (GetPetsNamesResponse200JSON) Write ¶ added in v0.0.2
func (r GetPetsNamesResponse200JSON) Write(w http.ResponseWriter)
type GetPetsRequest ¶
func (GetPetsRequest) Parse ¶ added in v0.0.2
func (r GetPetsRequest) Parse() GetPetsRequest
type GetPetsRequestParser ¶ added in v0.0.2
type GetPetsRequestParser interface {
Parse() GetPetsRequest
}
func GetPetsHTTPRequest ¶ added in v0.0.2
func GetPetsHTTPRequest(r *http.Request) GetPetsRequestParser
type GetPetsResponse ¶ added in v0.0.2
type GetPetsResponse interface {
Write(w http.ResponseWriter)
// contains filtered or unexported methods
}
func NewGetPetsResponse200JSON ¶ added in v0.0.2
func NewGetPetsResponse200JSON(body []Pet) GetPetsResponse
type GetPetsResponse200JSON ¶
type GetPetsResponse200JSON struct {
Body []Pet
}
func (GetPetsResponse200JSON) Write ¶ added in v0.0.2
func (r GetPetsResponse200JSON) Write(w http.ResponseWriter)
type HTTPClient ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.