Documentation
¶
Index ¶
- Constants
- Variables
- func SchemaPath(r *http.Request) (string, bool)
- func SpecFileHandler() http.Handler
- type API
- type Cat
- type Cat2
- type Client
- type Dog
- type Dog2
- type Dog2_Schema
- type Dog_Schema
- type ErrParseParam
- type GetPet2HandlerFunc
- type GetPet2Params
- type GetPet2Request
- type GetPet2Response
- type GetPet2Response200JSON
- type GetPetHandlerFunc
- type GetPetParams
- type GetPetRequest
- type GetPetResponse
- type GetPetResponse200JSON
- type HTTPClient
- type HTTPClientFunc
- type Pet
- type Pet2
- type PetOneOf2
- type Resp
- type Resp2
Constants ¶
View Source
const SpecFile string = `` /* 2383-byte string literal not displayed */
Variables ¶
Functions ¶
func SpecFileHandler ¶
Types ¶
type API ¶
type API struct {
GetPetHandler GetPetHandlerFunc
GetPet2Handler GetPet2HandlerFunc
// not found
NotFoundHandler http.Handler
// spec file
SpecFileHandler http.Handler
Middlewares []func(h http.Handler) http.Handler
}
func (API) TestClient ¶
type Client ¶
type Client struct {
BaseURL string
HTTPClient HTTPClient
}
func NewClient ¶
func NewClient(baseURL string, httpClient HTTPClient) *Client
func (*Client) GetPet ¶
func (c *Client) GetPet(ctx context.Context, request GetPetParams) (GetPetResponse, error)
GetPet GET /pet
func (*Client) GetPet2 ¶
func (c *Client) GetPet2(ctx context.Context, request GetPet2Params) (GetPet2Response, error)
GetPet2 GET /pet2
type Dog2_Schema ¶
func (Dog2_Schema) MarshalJSON ¶
func (c Dog2_Schema) MarshalJSON() ([]byte, error)
func (*Dog2_Schema) UnmarshalJSON ¶
func (c *Dog2_Schema) UnmarshalJSON(bs []byte) error
type Dog_Schema ¶
func (Dog_Schema) MarshalJSON ¶
func (c Dog_Schema) MarshalJSON() ([]byte, error)
func (*Dog_Schema) UnmarshalJSON ¶
func (c *Dog_Schema) UnmarshalJSON(bs []byte) error
type ErrParseParam ¶
func (ErrParseParam) Error ¶
func (e ErrParseParam) Error() string
func (ErrParseParam) Unwrap ¶
func (e ErrParseParam) Unwrap() error
type GetPet2HandlerFunc ¶
type GetPet2HandlerFunc func(ctx context.Context, r GetPet2Request) GetPet2Response
func (GetPet2HandlerFunc) ServeHTTP ¶
func (f GetPet2HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetPet2Params ¶
type GetPet2Params struct {
Body Pet2
}
func (GetPet2Params) HTTP ¶
func (r GetPet2Params) HTTP() *http.Request
func (GetPet2Params) Parse ¶
func (r GetPet2Params) Parse() (GetPet2Params, error)
type GetPet2Request ¶
type GetPet2Request interface {
HTTP() *http.Request
Parse() (GetPet2Params, error)
}
func GetPet2HTTPRequest ¶
func GetPet2HTTPRequest(r *http.Request) GetPet2Request
type GetPet2Response ¶
type GetPet2Response interface {
// contains filtered or unexported methods
}
func NewGetPet2Response200JSON ¶
func NewGetPet2Response200JSON(body Resp2) GetPet2Response
type GetPet2Response200JSON ¶
type GetPet2Response200JSON struct {
Body Resp2
}
GetPet2Response200JSON - OK
func (GetPet2Response200JSON) Write ¶
func (r GetPet2Response200JSON) Write(w http.ResponseWriter)
type GetPetHandlerFunc ¶
type GetPetHandlerFunc func(ctx context.Context, r GetPetRequest) GetPetResponse
func (GetPetHandlerFunc) ServeHTTP ¶
func (f GetPetHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetPetParams ¶
type GetPetParams struct {
Body Pet
}
func (GetPetParams) HTTP ¶
func (r GetPetParams) HTTP() *http.Request
func (GetPetParams) Parse ¶
func (r GetPetParams) Parse() (GetPetParams, error)
type GetPetRequest ¶
type GetPetRequest interface {
HTTP() *http.Request
Parse() (GetPetParams, error)
}
func GetPetHTTPRequest ¶
func GetPetHTTPRequest(r *http.Request) GetPetRequest
type GetPetResponse ¶
type GetPetResponse interface {
// contains filtered or unexported methods
}
func NewGetPetResponse200JSON ¶
func NewGetPetResponse200JSON(body Resp) GetPetResponse
type GetPetResponse200JSON ¶
type GetPetResponse200JSON struct {
Body Resp
}
GetPetResponse200JSON - OK
func (GetPetResponse200JSON) Write ¶
func (r GetPetResponse200JSON) Write(w http.ResponseWriter)
type HTTPClientFunc ¶
type Pet ¶
type Pet struct {
Cat pkg.Maybe[Cat]
Dog pkg.Maybe[pkg.Dog]
OneOf2 pkg.Maybe[PetOneOf2]
OneOf3 pkg.Maybe[int64]
OneOf4 pkg.Maybe[string]
}
func NewPetOneOf2 ¶
func NewPetOneOf3 ¶
func NewPetOneOf4 ¶
func (Pet) MarshalJSON ¶
func (*Pet) UnmarshalJSON ¶
type Pet2 ¶
func NewPet2Cat2 ¶
func NewPet2Dog2 ¶
func (Pet2) MarshalJSON ¶
func (*Pet2) UnmarshalJSON ¶
type PetOneOf2 ¶
type PetOneOf2 struct {
ID int64
}
func (PetOneOf2) MarshalJSON ¶
func (*PetOneOf2) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.