Documentation ¶
Index ¶
- func CreateHeroPath() string
- func ListHeroPath() string
- func ShowHeroPath(heroID int) string
- type Client
- func (c *Client) CreateHero(ctx context.Context, path string, payload *CreateHeroPayload, ...) (*http.Response, error)
- func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)
- func (c *Client) DecodeHero(resp *http.Response) (*Hero, error)
- func (c *Client) DecodeHeroCollection(resp *http.Response) (HeroCollection, error)
- func (c *Client) ListHero(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) NewCreateHeroRequest(ctx context.Context, path string, payload *CreateHeroPayload, ...) (*http.Request, error)
- func (c *Client) NewListHeroRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewShowHeroRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) ShowHero(ctx context.Context, path string) (*http.Response, error)
- type CreateHeroPayload
- type Hero
- type HeroCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHeroPath ¶
func CreateHeroPath() string
CreateHeroPath computes a request path to the create action of hero.
func ListHeroPath ¶
func ListHeroPath() string
ListHeroPath computes a request path to the list action of hero.
func ShowHeroPath ¶
ShowHeroPath computes a request path to the show action of hero.
Types ¶
type Client ¶
type Client struct { *goaclient.Client Encoder *goa.HTTPEncoder Decoder *goa.HTTPDecoder }
Client is the comics service client.
func (*Client) CreateHero ¶
func (c *Client) CreateHero(ctx context.Context, path string, payload *CreateHeroPayload, contentType string) (*http.Response, error)
Create new hero
func (*Client) DecodeErrorResponse ¶
DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.
func (*Client) DecodeHero ¶
DecodeHero decodes the Hero instance encoded in resp body.
func (*Client) DecodeHeroCollection ¶
func (c *Client) DecodeHeroCollection(resp *http.Response) (HeroCollection, error)
DecodeHeroCollection decodes the HeroCollection instance encoded in resp body.
func (*Client) NewCreateHeroRequest ¶
func (c *Client) NewCreateHeroRequest(ctx context.Context, path string, payload *CreateHeroPayload, contentType string) (*http.Request, error)
NewCreateHeroRequest create the request corresponding to the create action endpoint of the hero resource.
func (*Client) NewListHeroRequest ¶
NewListHeroRequest create the request corresponding to the list action endpoint of the hero resource.
func (*Client) NewShowHeroRequest ¶
NewShowHeroRequest create the request corresponding to the show action endpoint of the hero resource.
type CreateHeroPayload ¶
type CreateHeroPayload struct {
Name string `form:"name" json:"name" xml:"name"`
}
CreateHeroPayload is the hero create action payload.
type Hero ¶
type Hero struct { // Unique heroe ID ID int `form:"id" json:"id" xml:"id"` // Name of hero Name string `form:"name" json:"name" xml:"name"` }
A comic hero (default view)
Identifier: application/vnd.hero+json; view=default
type HeroCollection ¶
type HeroCollection []*Hero
HeroCollection is the media type for an array of Hero (default view)
Identifier: application/vnd.hero+json; type=collection; view=default
func (HeroCollection) Validate ¶
func (mt HeroCollection) Validate() (err error)
Validate validates the HeroCollection media type instance.