client

package
v0.0.0-...-cad71b5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRatingPath

func DeleteRatingPath(movieID int, userID int) string

DeleteRatingPath computes a request path to the delete action of rating.

func HealthHealthPath

func HealthHealthPath() string

HealthHealthPath computes a request path to the health action of health.

func ReadRatingPath

func ReadRatingPath(movieID int, userID int) string

ReadRatingPath computes a request path to the read action of rating.

func UpsertRatingPath

func UpsertRatingPath() string

UpsertRatingPath computes a request path to the upsert action of rating.

Types

type Client

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

Client is the db service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) DecodeRating

func (c *Client) DecodeRating(resp *http.Response) (*Rating, error)

DecodeRating decodes the Rating instance encoded in resp body.

func (*Client) DeleteRating

func (c *Client) DeleteRating(ctx context.Context, path string) (*http.Response, error)

Delete rating record

func (*Client) DownloadSwaggerJSON

func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)

DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) HealthHealth

func (c *Client) HealthHealth(ctx context.Context, path string) (*http.Response, error)

Status of the API.

func (*Client) NewDeleteRatingRequest

func (c *Client) NewDeleteRatingRequest(ctx context.Context, path string) (*http.Request, error)

NewDeleteRatingRequest create the request corresponding to the delete action endpoint of the rating resource.

func (*Client) NewHealthHealthRequest

func (c *Client) NewHealthHealthRequest(ctx context.Context, path string) (*http.Request, error)

NewHealthHealthRequest create the request corresponding to the health action endpoint of the health resource.

func (*Client) NewReadRatingRequest

func (c *Client) NewReadRatingRequest(ctx context.Context, path string) (*http.Request, error)

NewReadRatingRequest create the request corresponding to the read action endpoint of the rating resource.

func (*Client) NewUpsertRatingRequest

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

NewUpsertRatingRequest create the request corresponding to the upsert action endpoint of the rating resource.

func (*Client) ReadRating

func (c *Client) ReadRating(ctx context.Context, path string) (*http.Response, error)

Retrieves a rating record

func (*Client) UpsertRating

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

Adds a rating record

type Rating

type Rating struct {
	MovieID int     `form:"movieId" json:"movieId" xml:"movieId"`
	Rating  float64 `form:"rating" json:"rating" xml:"rating"`
	UserID  int     `form:"userId" json:"userId" xml:"userId"`
}

A movie rating by a user (default view)

Identifier: application/cassandra.wannabe.rating+json; view=default

func (*Rating) Validate

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

Validate validates the Rating media type instance.

type RatingPayload

type RatingPayload struct {
	MovieID int     `form:"movieId" json:"movieId" xml:"movieId"`
	Rating  float64 `form:"rating" json:"rating" xml:"rating"`
	UserID  int     `form:"userId" json:"userId" xml:"userId"`
}

RatingPayload user type.

func (*RatingPayload) Validate

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

Validate validates the RatingPayload type instance.

Jump to

Keyboard shortcuts

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