client

package
v0.0.0-...-eecba0e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserPath

func CreateUserPath() string

CreateUserPath computes a request path to the create action of user.

func IndexUserPath

func IndexUserPath() string

IndexUserPath computes a request path to the index action of user.

func ShowBottlePath

func ShowBottlePath(bottleID int) string

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

func ShowUserPath

func ShowUserPath(userID int) string

ShowUserPath computes a request path to the show action of user.

func UpdateUserPath

func UpdateUserPath(userID int) string

UpdateUserPath computes a request path to the update action of user.

Types

type ApplicationVndUser

type ApplicationVndUser struct {
	// description
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// id
	ID *int `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// title
	Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
}

user media type (default view)

Identifier: application.vnd.user+json; view=default

type ApplicationVndUserCollection

type ApplicationVndUserCollection []*ApplicationVndUser

ApplicationVndUserCollection is the media type for an array of ApplicationVndUser (default view)

Identifier: application.vnd.user+json; type=collection; view=default

type Client

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

Client is the celler service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateUser

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

Create user

func (*Client) DecodeApplicationVndUser

func (c *Client) DecodeApplicationVndUser(resp *http.Response) (*ApplicationVndUser, error)

DecodeApplicationVndUser decodes the ApplicationVndUser instance encoded in resp body.

func (*Client) DecodeApplicationVndUserCollection

func (c *Client) DecodeApplicationVndUserCollection(resp *http.Response) (ApplicationVndUserCollection, error)

DecodeApplicationVndUserCollection decodes the ApplicationVndUserCollection instance encoded in resp body.

func (*Client) DecodeGoaExampleCom

func (c *Client) DecodeGoaExampleCom(resp *http.Response) (*GoaExampleCom, error)

DecodeGoaExampleCom decodes the GoaExampleCom instance encoded in resp body.

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) DownloadSwaggerui

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

DownloadSwaggerui downloads /files with the given filename and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) IndexUser

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

List users

func (*Client) NewCreateUserRequest

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

NewCreateUserRequest create the request corresponding to the create action endpoint of the user resource.

func (*Client) NewIndexUserRequest

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

NewIndexUserRequest create the request corresponding to the index action endpoint of the user resource.

func (*Client) NewShowBottleRequest

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

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

func (*Client) NewShowUserRequest

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

NewShowUserRequest create the request corresponding to the show action endpoint of the user resource.

func (*Client) NewUpdateUserRequest

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

NewUpdateUserRequest create the request corresponding to the update action endpoint of the user resource.

func (*Client) ShowBottle

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

Get bottle by id

func (*Client) ShowUser

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

Get user by id

func (*Client) UpdateUser

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

Update user

type GoaExampleCom

type GoaExampleCom struct {
	// API href for making requests on the bottle
	Href string `form:"href" json:"href" xml:"href"`
	// Unique bottle ID
	ID int `form:"id" json:"id" xml:"id"`
	// Name of wine
	Name string `form:"name" json:"name" xml:"name"`
}

A bottle of wine (default view)

Identifier: application/vnd.goa.example.com+json; view=default

func (*GoaExampleCom) Validate

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

Validate validates the GoaExampleCom media type instance.

type UserPayload

type UserPayload struct {
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	Title       *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
}

UserPayload user type.

Jump to

Keyboard shortcuts

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