client

package
v0.0.0-...-a15f217 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBottlePath

func CreateBottlePath() string

CreateBottlePath computes a request path to the create action of bottle.

func ShowBottlePath

func ShowBottlePath(id int) string

ShowBottlePath computes a request path to the show action of bottle.

Types

type Bottle

type Bottle struct {
	// Unique bottle ID
	ID int `form:"ID" json:"ID" yaml:"ID" xml:"ID"`
	// Name of bottle
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// Rating of bottle
	Rating int `form:"rating" json:"rating" yaml:"rating" xml:"rating"`
	// Vintage of bottle
	Vintage int `form:"vintage" json:"vintage" yaml:"vintage" xml:"vintage"`
}

bottle media type (default view)

Identifier: application/vnd.gophercon.goa.bottle; view=default

func (*Bottle) Validate

func (mt *Bottle) Validate() (err error)

Validate validates the Bottle media type instance.

type BottlePayload

type BottlePayload struct {
	// Name of bottle
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// Rating of bottle
	Rating int `form:"rating" json:"rating" yaml:"rating" xml:"rating"`
	// Vintage of bottle
	Vintage int `form:"vintage" json:"vintage" yaml:"vintage" xml:"vintage"`
}

BottlePayload that creates bottles

func (*BottlePayload) Validate

func (ut *BottlePayload) Validate() (err error)

Validate validates the BottlePayload type instance.

type Client

type Client struct {
	*goaclient.Client
	Encoder *goa.HTTPEncoder
	Decoder *goa.HTTPDecoder
}

Client is the cellar service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateBottle

func (c *Client) CreateBottle(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Response, error)

creates a bottle

func (*Client) DecodeBottle

func (c *Client) DecodeBottle(resp *http.Response) (*Bottle, error)

DecodeBottle decodes the Bottle instance encoded in resp body.

func (*Client) NewCreateBottleRequest

func (c *Client) NewCreateBottleRequest(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Request, error)

NewCreateBottleRequest create the request corresponding to the create action endpoint of the bottle resource.

func (*Client) NewShowBottleRequest

func (c *Client) NewShowBottleRequest(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Request, error)

NewShowBottleRequest create the request corresponding to the show action endpoint of the bottle resource.

func (*Client) ShowBottle

func (c *Client) ShowBottle(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Response, error)

show a bottle

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL