Documentation ¶
Index ¶
- Constants
- Variables
- func SchemaPath(r *http.Request) (string, bool)
- func SpecFileHandler() http.Handler
- type API
- type Client
- func (c *Client) Get(ctx context.Context, request GetParams) (GetResponse, error)
- func (c *Client) GetShops(ctx context.Context, request GetShopsParams) (GetShopsResponse, error)
- func (c *Client) GetShopsActivate(ctx context.Context, request GetShopsActivateParams) (GetShopsActivateResponse, error)
- func (c *Client) GetShopsMinePetsMikeTails(ctx context.Context, request GetShopsMinePetsMikeTailsParams) (GetShopsMinePetsMikeTailsResponse, error)
- func (c *Client) GetShopsRT(ctx context.Context, request GetShopsRTParams) (GetShopsRTResponse, error)
- func (c *Client) GetShopsShop(ctx context.Context, request GetShopsShopParams) (GetShopsShopResponse, error)
- func (c *Client) GetShopsShopPets(ctx context.Context, request GetShopsShopPetsParams) (GetShopsShopPetsResponse, error)
- func (c *Client) GetShopsShopPetsMikePaws(ctx context.Context, request GetShopsShopPetsMikePawsParams) (GetShopsShopPetsMikePawsResponse, error)
- func (c *Client) GetShopsShopRT(ctx context.Context, request GetShopsShopRTParams) (GetShopsShopRTResponse, error)
- type ErrParseParam
- type GetHandlerFunc
- type GetParams
- type GetRequest
- type GetResponse
- type GetResponseDefault
- type GetShopsActivateHandlerFunc
- type GetShopsActivateParams
- type GetShopsActivateRequest
- type GetShopsActivateResponse
- type GetShopsActivateResponseDefault
- type GetShopsHandlerFunc
- type GetShopsMinePetsMikeTailsHandlerFunc
- type GetShopsMinePetsMikeTailsParams
- type GetShopsMinePetsMikeTailsRequest
- type GetShopsMinePetsMikeTailsResponse
- type GetShopsMinePetsMikeTailsResponseDefault
- type GetShopsParams
- type GetShopsRTHandlerFunc
- type GetShopsRTParams
- type GetShopsRTRequest
- type GetShopsRTResponse
- type GetShopsRTResponseDefault
- type GetShopsRequest
- type GetShopsResponse
- type GetShopsResponseDefault
- type GetShopsShopHandlerFunc
- type GetShopsShopParams
- type GetShopsShopParamsPath
- type GetShopsShopPetsHandlerFunc
- type GetShopsShopPetsMikePawsHandlerFunc
- type GetShopsShopPetsMikePawsParams
- type GetShopsShopPetsMikePawsParamsPath
- type GetShopsShopPetsMikePawsRequest
- type GetShopsShopPetsMikePawsResponse
- type GetShopsShopPetsMikePawsResponseDefault
- type GetShopsShopPetsParams
- type GetShopsShopPetsParamsPath
- type GetShopsShopPetsRequest
- type GetShopsShopPetsResponse
- type GetShopsShopPetsResponseDefault
- type GetShopsShopRTHandlerFunc
- type GetShopsShopRTParams
- type GetShopsShopRTParamsPath
- type GetShopsShopRTRequest
- type GetShopsShopRTResponse
- type GetShopsShopRTResponseDefault
- type GetShopsShopRequest
- type GetShopsShopResponse
- type GetShopsShopResponseDefault
- type HTTPClient
- type HTTPClientFunc
- type Maybe
Constants ¶
View Source
const SpecFile string = `servers:
# - url: "https://demo.example.com:8443/api/v1"
- url: https://{username}.example.com:{port}/{basePath}
description: The production API server
variables:
username:
default: demo
port:
default: '8443'
basePath:
default: api/v1
paths:
# some ` + "`" + `comment` + "`" + `
/: {get: {responses: {default: {}}}}
/shops: {get: {responses: {default: {}}}}
/shops/: {get: {responses: {default: {}}}}
/shops/{shop}: {get: {parameters: [{in: path, name: shop, required: true, schema: {type: string}}], responses: {default: {}}}}
/shops/{shop}/: {get: {parameters: [{in: path, name: shop, required: true, schema: {type: string}}], responses: {default: {}}}}
/shops/{shop}/pets: {get: {parameters: [{in: path, name: shop, required: true, schema: {type: string}}], responses: {default: {}}}}
/shops/{shop}/pets/mike/paws: {get: {parameters: [{in: path, name: shop, required: true, schema: {type: string}}], responses: {default: {}}}}
/shops/mine/pets/mike/tails: {get: {responses: {default: {}}}}
/shops/activate: {get: {responses: {default: {}}}}
`
Variables ¶
Functions ¶
func SpecFileHandler ¶
Types ¶
type API ¶
type API struct { GetHandler GetHandlerFunc GetShopsHandler GetShopsHandlerFunc GetShopsRTHandler GetShopsRTHandlerFunc GetShopsActivateHandler GetShopsActivateHandlerFunc GetShopsMinePetsMikeTailsHandler GetShopsMinePetsMikeTailsHandlerFunc GetShopsShopHandler GetShopsShopHandlerFunc GetShopsShopRTHandler GetShopsShopRTHandlerFunc GetShopsShopPetsHandler GetShopsShopPetsHandlerFunc GetShopsShopPetsMikePawsHandler GetShopsShopPetsMikePawsHandlerFunc // 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) GetShops ¶ added in v0.0.2
func (c *Client) GetShops(ctx context.Context, request GetShopsParams) (GetShopsResponse, error)
GetShops - GET /shops
func (*Client) GetShopsActivate ¶ added in v0.0.2
func (c *Client) GetShopsActivate(ctx context.Context, request GetShopsActivateParams) (GetShopsActivateResponse, error)
GetShopsActivate - GET /shops/activate
func (*Client) GetShopsMinePetsMikeTails ¶ added in v0.1.12
func (c *Client) GetShopsMinePetsMikeTails(ctx context.Context, request GetShopsMinePetsMikeTailsParams) (GetShopsMinePetsMikeTailsResponse, error)
GetShopsMinePetsMikeTails - GET /shops/mine/pets/mike/tails
func (*Client) GetShopsRT ¶ added in v0.0.2
func (c *Client) GetShopsRT(ctx context.Context, request GetShopsRTParams) (GetShopsRTResponse, error)
GetShopsRT - GET /shops/
func (*Client) GetShopsShop ¶ added in v0.0.2
func (c *Client) GetShopsShop(ctx context.Context, request GetShopsShopParams) (GetShopsShopResponse, error)
GetShopsShop - GET /shops/{shop}
func (*Client) GetShopsShopPets ¶ added in v0.0.2
func (c *Client) GetShopsShopPets(ctx context.Context, request GetShopsShopPetsParams) (GetShopsShopPetsResponse, error)
GetShopsShopPets - GET /shops/{shop}/pets
func (*Client) GetShopsShopPetsMikePaws ¶ added in v0.0.4
func (c *Client) GetShopsShopPetsMikePaws(ctx context.Context, request GetShopsShopPetsMikePawsParams) (GetShopsShopPetsMikePawsResponse, error)
GetShopsShopPetsMikePaws - GET /shops/{shop}/pets/mike/paws
func (*Client) GetShopsShopRT ¶ added in v0.0.2
func (c *Client) GetShopsShopRT(ctx context.Context, request GetShopsShopRTParams) (GetShopsShopRTResponse, error)
GetShopsShopRT - GET /shops/{shop}/
type ErrParseParam ¶
func (ErrParseParam) Error ¶
func (e ErrParseParam) Error() string
func (ErrParseParam) Unwrap ¶
func (e ErrParseParam) Unwrap() error
type GetHandlerFunc ¶ added in v0.0.2
type GetHandlerFunc func(ctx context.Context, r GetRequest) GetResponse
func (GetHandlerFunc) ServeHTTP ¶ added in v0.0.2
func (f GetHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetRequest ¶ added in v0.0.2
func GetHTTPRequest ¶ added in v0.0.2
func GetHTTPRequest(r *http.Request) GetRequest
type GetResponse ¶ added in v0.0.2
type GetResponse interface {
// contains filtered or unexported methods
}
func NewGetResponseDefault ¶ added in v0.0.2
func NewGetResponseDefault(code int) GetResponse
type GetResponseDefault ¶ added in v0.0.2
type GetResponseDefault struct {
Code int
}
func (GetResponseDefault) Write ¶ added in v0.0.2
func (r GetResponseDefault) Write(w http.ResponseWriter)
type GetShopsActivateHandlerFunc ¶
type GetShopsActivateHandlerFunc func(ctx context.Context, r GetShopsActivateRequest) GetShopsActivateResponse
func (GetShopsActivateHandlerFunc) ServeHTTP ¶
func (f GetShopsActivateHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsActivateParams ¶ added in v0.0.3
type GetShopsActivateParams struct { }
func (GetShopsActivateParams) HTTP ¶ added in v0.0.3
func (r GetShopsActivateParams) HTTP() *http.Request
func (GetShopsActivateParams) Parse ¶ added in v0.0.3
func (r GetShopsActivateParams) Parse() GetShopsActivateParams
type GetShopsActivateRequest ¶
type GetShopsActivateRequest interface { HTTP() *http.Request Parse() GetShopsActivateParams }
func GetShopsActivateHTTPRequest ¶ added in v0.0.2
func GetShopsActivateHTTPRequest(r *http.Request) GetShopsActivateRequest
type GetShopsActivateResponse ¶ added in v0.0.2
type GetShopsActivateResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsActivateResponseDefault ¶ added in v0.0.2
func NewGetShopsActivateResponseDefault(code int) GetShopsActivateResponse
type GetShopsActivateResponseDefault ¶
type GetShopsActivateResponseDefault struct {
Code int
}
func (GetShopsActivateResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsActivateResponseDefault) Write(w http.ResponseWriter)
type GetShopsHandlerFunc ¶
type GetShopsHandlerFunc func(ctx context.Context, r GetShopsRequest) GetShopsResponse
func (GetShopsHandlerFunc) ServeHTTP ¶
func (f GetShopsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsMinePetsMikeTailsHandlerFunc ¶ added in v0.1.12
type GetShopsMinePetsMikeTailsHandlerFunc func(ctx context.Context, r GetShopsMinePetsMikeTailsRequest) GetShopsMinePetsMikeTailsResponse
func (GetShopsMinePetsMikeTailsHandlerFunc) ServeHTTP ¶ added in v0.1.12
func (f GetShopsMinePetsMikeTailsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsMinePetsMikeTailsParams ¶ added in v0.1.12
type GetShopsMinePetsMikeTailsParams struct { }
func (GetShopsMinePetsMikeTailsParams) HTTP ¶ added in v0.1.12
func (r GetShopsMinePetsMikeTailsParams) HTTP() *http.Request
func (GetShopsMinePetsMikeTailsParams) Parse ¶ added in v0.1.12
func (r GetShopsMinePetsMikeTailsParams) Parse() GetShopsMinePetsMikeTailsParams
type GetShopsMinePetsMikeTailsRequest ¶ added in v0.1.12
type GetShopsMinePetsMikeTailsRequest interface { HTTP() *http.Request Parse() GetShopsMinePetsMikeTailsParams }
func GetShopsMinePetsMikeTailsHTTPRequest ¶ added in v0.1.12
func GetShopsMinePetsMikeTailsHTTPRequest(r *http.Request) GetShopsMinePetsMikeTailsRequest
type GetShopsMinePetsMikeTailsResponse ¶ added in v0.1.12
type GetShopsMinePetsMikeTailsResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsMinePetsMikeTailsResponseDefault ¶ added in v0.1.12
func NewGetShopsMinePetsMikeTailsResponseDefault(code int) GetShopsMinePetsMikeTailsResponse
type GetShopsMinePetsMikeTailsResponseDefault ¶ added in v0.1.12
type GetShopsMinePetsMikeTailsResponseDefault struct {
Code int
}
func (GetShopsMinePetsMikeTailsResponseDefault) Write ¶ added in v0.1.12
func (r GetShopsMinePetsMikeTailsResponseDefault) Write(w http.ResponseWriter)
type GetShopsParams ¶ added in v0.0.3
type GetShopsParams struct { }
func (GetShopsParams) HTTP ¶ added in v0.0.3
func (r GetShopsParams) HTTP() *http.Request
func (GetShopsParams) Parse ¶ added in v0.0.3
func (r GetShopsParams) Parse() GetShopsParams
type GetShopsRTHandlerFunc ¶
type GetShopsRTHandlerFunc func(ctx context.Context, r GetShopsRTRequest) GetShopsRTResponse
func (GetShopsRTHandlerFunc) ServeHTTP ¶
func (f GetShopsRTHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsRTParams ¶ added in v0.0.3
type GetShopsRTParams struct { }
func (GetShopsRTParams) HTTP ¶ added in v0.0.3
func (r GetShopsRTParams) HTTP() *http.Request
func (GetShopsRTParams) Parse ¶ added in v0.0.3
func (r GetShopsRTParams) Parse() GetShopsRTParams
type GetShopsRTRequest ¶
type GetShopsRTRequest interface { HTTP() *http.Request Parse() GetShopsRTParams }
func GetShopsRTHTTPRequest ¶ added in v0.0.2
func GetShopsRTHTTPRequest(r *http.Request) GetShopsRTRequest
type GetShopsRTResponse ¶ added in v0.0.2
type GetShopsRTResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsRTResponseDefault ¶ added in v0.0.2
func NewGetShopsRTResponseDefault(code int) GetShopsRTResponse
type GetShopsRTResponseDefault ¶
type GetShopsRTResponseDefault struct {
Code int
}
func (GetShopsRTResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsRTResponseDefault) Write(w http.ResponseWriter)
type GetShopsRequest ¶
type GetShopsRequest interface { HTTP() *http.Request Parse() GetShopsParams }
func GetShopsHTTPRequest ¶ added in v0.0.2
func GetShopsHTTPRequest(r *http.Request) GetShopsRequest
type GetShopsResponse ¶ added in v0.0.2
type GetShopsResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsResponseDefault ¶ added in v0.0.2
func NewGetShopsResponseDefault(code int) GetShopsResponse
type GetShopsResponseDefault ¶
type GetShopsResponseDefault struct {
Code int
}
func (GetShopsResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsResponseDefault) Write(w http.ResponseWriter)
type GetShopsShopHandlerFunc ¶
type GetShopsShopHandlerFunc func(ctx context.Context, r GetShopsShopRequest) GetShopsShopResponse
func (GetShopsShopHandlerFunc) ServeHTTP ¶
func (f GetShopsShopHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsShopParams ¶ added in v0.0.3
type GetShopsShopParams struct {
Path GetShopsShopParamsPath
}
func (GetShopsShopParams) HTTP ¶ added in v0.0.3
func (r GetShopsShopParams) HTTP() *http.Request
func (GetShopsShopParams) Parse ¶ added in v0.0.3
func (r GetShopsShopParams) Parse() (GetShopsShopParams, error)
type GetShopsShopParamsPath ¶ added in v0.1.18
type GetShopsShopParamsPath struct {
Shop string
}
type GetShopsShopPetsHandlerFunc ¶
type GetShopsShopPetsHandlerFunc func(ctx context.Context, r GetShopsShopPetsRequest) GetShopsShopPetsResponse
func (GetShopsShopPetsHandlerFunc) ServeHTTP ¶
func (f GetShopsShopPetsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsShopPetsMikePawsHandlerFunc ¶ added in v0.0.4
type GetShopsShopPetsMikePawsHandlerFunc func(ctx context.Context, r GetShopsShopPetsMikePawsRequest) GetShopsShopPetsMikePawsResponse
func (GetShopsShopPetsMikePawsHandlerFunc) ServeHTTP ¶ added in v0.0.4
func (f GetShopsShopPetsMikePawsHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsShopPetsMikePawsParams ¶ added in v0.0.4
type GetShopsShopPetsMikePawsParams struct {
Path GetShopsShopPetsMikePawsParamsPath
}
func (GetShopsShopPetsMikePawsParams) HTTP ¶ added in v0.0.4
func (r GetShopsShopPetsMikePawsParams) HTTP() *http.Request
func (GetShopsShopPetsMikePawsParams) Parse ¶ added in v0.0.4
func (r GetShopsShopPetsMikePawsParams) Parse() (GetShopsShopPetsMikePawsParams, error)
type GetShopsShopPetsMikePawsParamsPath ¶ added in v0.1.18
type GetShopsShopPetsMikePawsParamsPath struct {
Shop string
}
type GetShopsShopPetsMikePawsRequest ¶ added in v0.0.4
type GetShopsShopPetsMikePawsRequest interface { HTTP() *http.Request Parse() (GetShopsShopPetsMikePawsParams, error) }
func GetShopsShopPetsMikePawsHTTPRequest ¶ added in v0.0.4
func GetShopsShopPetsMikePawsHTTPRequest(r *http.Request) GetShopsShopPetsMikePawsRequest
type GetShopsShopPetsMikePawsResponse ¶ added in v0.0.4
type GetShopsShopPetsMikePawsResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsShopPetsMikePawsResponseDefault ¶ added in v0.0.4
func NewGetShopsShopPetsMikePawsResponseDefault(code int) GetShopsShopPetsMikePawsResponse
type GetShopsShopPetsMikePawsResponseDefault ¶ added in v0.0.4
type GetShopsShopPetsMikePawsResponseDefault struct {
Code int
}
func (GetShopsShopPetsMikePawsResponseDefault) Write ¶ added in v0.0.4
func (r GetShopsShopPetsMikePawsResponseDefault) Write(w http.ResponseWriter)
type GetShopsShopPetsParams ¶ added in v0.0.3
type GetShopsShopPetsParams struct {
Path GetShopsShopPetsParamsPath
}
func (GetShopsShopPetsParams) HTTP ¶ added in v0.0.3
func (r GetShopsShopPetsParams) HTTP() *http.Request
func (GetShopsShopPetsParams) Parse ¶ added in v0.0.3
func (r GetShopsShopPetsParams) Parse() (GetShopsShopPetsParams, error)
type GetShopsShopPetsParamsPath ¶ added in v0.1.18
type GetShopsShopPetsParamsPath struct {
Shop string
}
type GetShopsShopPetsRequest ¶
type GetShopsShopPetsRequest interface { HTTP() *http.Request Parse() (GetShopsShopPetsParams, error) }
func GetShopsShopPetsHTTPRequest ¶ added in v0.0.2
func GetShopsShopPetsHTTPRequest(r *http.Request) GetShopsShopPetsRequest
type GetShopsShopPetsResponse ¶ added in v0.0.2
type GetShopsShopPetsResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsShopPetsResponseDefault ¶ added in v0.0.2
func NewGetShopsShopPetsResponseDefault(code int) GetShopsShopPetsResponse
type GetShopsShopPetsResponseDefault ¶
type GetShopsShopPetsResponseDefault struct {
Code int
}
func (GetShopsShopPetsResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsShopPetsResponseDefault) Write(w http.ResponseWriter)
type GetShopsShopRTHandlerFunc ¶
type GetShopsShopRTHandlerFunc func(ctx context.Context, r GetShopsShopRTRequest) GetShopsShopRTResponse
func (GetShopsShopRTHandlerFunc) ServeHTTP ¶
func (f GetShopsShopRTHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetShopsShopRTParams ¶ added in v0.0.3
type GetShopsShopRTParams struct {
Path GetShopsShopRTParamsPath
}
func (GetShopsShopRTParams) HTTP ¶ added in v0.0.3
func (r GetShopsShopRTParams) HTTP() *http.Request
func (GetShopsShopRTParams) Parse ¶ added in v0.0.3
func (r GetShopsShopRTParams) Parse() (GetShopsShopRTParams, error)
type GetShopsShopRTParamsPath ¶ added in v0.1.18
type GetShopsShopRTParamsPath struct {
Shop string
}
type GetShopsShopRTRequest ¶
type GetShopsShopRTRequest interface { HTTP() *http.Request Parse() (GetShopsShopRTParams, error) }
func GetShopsShopRTHTTPRequest ¶ added in v0.0.2
func GetShopsShopRTHTTPRequest(r *http.Request) GetShopsShopRTRequest
type GetShopsShopRTResponse ¶ added in v0.0.2
type GetShopsShopRTResponse interface {
// contains filtered or unexported methods
}
func NewGetShopsShopRTResponseDefault ¶ added in v0.0.2
func NewGetShopsShopRTResponseDefault(code int) GetShopsShopRTResponse
type GetShopsShopRTResponseDefault ¶
type GetShopsShopRTResponseDefault struct {
Code int
}
func (GetShopsShopRTResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsShopRTResponseDefault) Write(w http.ResponseWriter)
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 {
// contains filtered or unexported methods
}
func NewGetShopsShopResponseDefault ¶ added in v0.0.2
func NewGetShopsShopResponseDefault(code int) GetShopsShopResponse
type GetShopsShopResponseDefault ¶
type GetShopsShopResponseDefault struct {
Code int
}
func (GetShopsShopResponseDefault) Write ¶ added in v0.0.2
func (r GetShopsShopResponseDefault) Write(w http.ResponseWriter)
type HTTPClient ¶ added in v0.0.2
type HTTPClientFunc ¶ added in v0.0.11
Click to show internal directories.
Click to hide internal directories.