Documentation ¶
Index ¶
- Constants
- Variables
- func SchemaPath(r *http.Request) (string, bool)
- func SpecFileHandler() http.Handler
- type API
- type Client
- type CreatePetJSON
- type ErrParseParam
- type Error
- type ErrorCode
- type ErrorResponseResponse
- type HTTPClient
- type HTTPClientFunc
- type Maybe
- type Nullable
- type Pet
- type Pets
- type PostPetsHandlerFunc
- type PostPetsParams
- type PostPetsRequest
- type PostPetsResponse
- type PostPetsResponse200JSON
- type PostShopsHandlerFunc
- type PostShopsParams
- type PostShopsRequest
- type PostShopsResponse
- type PostShopsResponse200JSON
Constants ¶
View Source
const SpecFile string = `` /* 1742-byte string literal not displayed */
Variables ¶
Functions ¶
func SpecFileHandler ¶
Types ¶
type API ¶
type API struct { PostPetsHandler PostPetsHandlerFunc PostShopsHandler PostShopsHandlerFunc // not found NotFoundHandler http.Handler // spec file SpecFileHandler http.Handler Middlewares []func(h http.Handler) http.Handler }
func (API) TestClient ¶ added in v0.1.28
type Client ¶
type Client struct { BaseURL string HTTPClient HTTPClient }
func NewClient ¶
func NewClient(baseURL string, httpClient HTTPClient) *Client
func (*Client) PostPets ¶
func (c *Client) PostPets(ctx context.Context, request PostPetsParams) (PostPetsResponse, error)
PostPets POST /pets
func (*Client) PostShops ¶
func (c *Client) PostShops(ctx context.Context, request PostShopsParams) (PostShopsResponse, error)
PostShops POST /shops
type CreatePetJSON ¶
type CreatePetJSON struct {
Name string `json:"name"`
}
type ErrParseParam ¶
func (ErrParseParam) Error ¶
func (e ErrParseParam) Error() string
func (ErrParseParam) Unwrap ¶
func (e ErrParseParam) Unwrap() error
type ErrorResponseResponse ¶
ErrorResponseResponse - Error response
func NewErrorResponseResponse ¶
func NewErrorResponseResponse(body Error, xErrorCode Maybe[int]) ErrorResponseResponse
func (ErrorResponseResponse) Write ¶
func (r ErrorResponseResponse) Write(w http.ResponseWriter, code int)
type HTTPClientFunc ¶
type Nullable ¶ added in v0.1.25
func (Nullable[T]) MarshalJSON ¶ added in v0.1.28
func (*Nullable[T]) UnmarshalJSON ¶ added in v0.1.28
type PostPetsHandlerFunc ¶
type PostPetsHandlerFunc func(ctx context.Context, r PostPetsRequest) PostPetsResponse
func (PostPetsHandlerFunc) ServeHTTP ¶
func (f PostPetsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PostPetsParams ¶
type PostPetsParams struct {
Body CreatePetJSON
}
func (PostPetsParams) HTTP ¶
func (r PostPetsParams) HTTP() *http.Request
func (PostPetsParams) Parse ¶
func (r PostPetsParams) Parse() (PostPetsParams, error)
type PostPetsRequest ¶
type PostPetsRequest interface { HTTP() *http.Request Parse() (PostPetsParams, error) }
func PostPetsHTTPRequest ¶
func PostPetsHTTPRequest(r *http.Request) PostPetsRequest
type PostPetsResponse ¶
type PostPetsResponse interface {
// contains filtered or unexported methods
}
func NewPostPetsResponse200JSON ¶
func NewPostPetsResponse200JSON(body Pets) PostPetsResponse
type PostPetsResponse200JSON ¶
type PostPetsResponse200JSON struct {
Body Pets
}
PostPetsResponse200JSON - Pets response
func (PostPetsResponse200JSON) Write ¶
func (r PostPetsResponse200JSON) Write(w http.ResponseWriter)
type PostShopsHandlerFunc ¶
type PostShopsHandlerFunc func(ctx context.Context, r PostShopsRequest) PostShopsResponse
func (PostShopsHandlerFunc) ServeHTTP ¶
func (f PostShopsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PostShopsParams ¶
type PostShopsParams struct {
Body CreatePetJSON
}
func (PostShopsParams) HTTP ¶
func (r PostShopsParams) HTTP() *http.Request
func (PostShopsParams) Parse ¶
func (r PostShopsParams) Parse() (PostShopsParams, error)
type PostShopsRequest ¶
type PostShopsRequest interface { HTTP() *http.Request Parse() (PostShopsParams, error) }
func PostShopsHTTPRequest ¶
func PostShopsHTTPRequest(r *http.Request) PostShopsRequest
type PostShopsResponse ¶
type PostShopsResponse interface {
// contains filtered or unexported methods
}
func NewPostShopsResponse200JSON ¶
func NewPostShopsResponse200JSON(body Pets) PostShopsResponse
type PostShopsResponse200JSON ¶
type PostShopsResponse200JSON struct {
Body Pets
}
PostShopsResponse200JSON - Pets response
func (PostShopsResponse200JSON) Write ¶
func (r PostShopsResponse200JSON) Write(w http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.