client

package
v0.0.0-...-abdcf8d Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSamplesPath

func AddSamplesPath() string

AddSamplesPath computes a request path to the add action of samples.

func DeleteSamplesPath

func DeleteSamplesPath(id int) string

DeleteSamplesPath computes a request path to the delete action of samples.

func ListSamplesPath

func ListSamplesPath() string

ListSamplesPath computes a request path to the list action of samples.

func ShowSamplesPath

func ShowSamplesPath(id int) string

ShowSamplesPath computes a request path to the show action of samples.

func UpdateSamplesPath

func UpdateSamplesPath(id int) string

UpdateSamplesPath computes a request path to the update action of samples.

Types

type AddSamplesPayload

type AddSamplesPayload struct {
	// detail of sample
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// name of sample
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// user id
	UserID string `form:"user_id" json:"user_id" yaml:"user_id" xml:"user_id"`
}

AddSamplesPayload is the samples add action payload.

type Client

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

Client is the goa-sample service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) AddSamples

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

追加

func (*Client) DecodeErrorResponse

func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)

DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.

func (*Client) DecodeSample

func (c *Client) DecodeSample(resp *http.Response) (*Sample, error)

DecodeSample decodes the Sample instance encoded in resp body.

func (*Client) DecodeSampleCollection

func (c *Client) DecodeSampleCollection(resp *http.Response) (SampleCollection, error)

DecodeSampleCollection decodes the SampleCollection instance encoded in resp body.

func (*Client) DecodeSamples

func (c *Client) DecodeSamples(resp *http.Response) (*Samples, error)

DecodeSamples decodes the Samples instance encoded in resp body.

func (*Client) DecodeSamplesCollection

func (c *Client) DecodeSamplesCollection(resp *http.Response) (SamplesCollection, error)

DecodeSamplesCollection decodes the SamplesCollection instance encoded in resp body.

func (*Client) DeleteSamples

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

削除

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

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

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

func (*Client) ListSamples

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

複数

func (*Client) NewAddSamplesRequest

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

NewAddSamplesRequest create the request corresponding to the add action endpoint of the samples resource.

func (*Client) NewDeleteSamplesRequest

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

NewDeleteSamplesRequest create the request corresponding to the delete action endpoint of the samples resource.

func (*Client) NewListSamplesRequest

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

NewListSamplesRequest create the request corresponding to the list action endpoint of the samples resource.

func (*Client) NewShowSamplesRequest

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

NewShowSamplesRequest create the request corresponding to the show action endpoint of the samples resource.

func (*Client) NewUpdateSamplesRequest

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

NewUpdateSamplesRequest create the request corresponding to the update action endpoint of the samples resource.

func (*Client) ShowSamples

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

単数

func (*Client) UpdateSamples

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

更新

type Sample

type Sample struct {
	// 作成日
	CreatedAt time.Time `form:"created_at" json:"created_at" yaml:"created_at" xml:"created_at"`
	// 詳細
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// sample id
	ID int `form:"id" json:"id" yaml:"id" xml:"id"`
	// 名前
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// 更新日
	UpdatedAt time.Time `form:"updated_at" json:"updated_at" yaml:"updated_at" xml:"updated_at"`
	// user id
	UserID int `form:"user_id" json:"user_id" yaml:"user_id" xml:"user_id"`
}

sample detail (default view)

Identifier: application/vnd.sample+json; view=default

func (*Sample) Validate

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

Validate validates the Sample media type instance.

type SampleCollection

type SampleCollection []*Sample

SampleCollection is the media type for an array of Sample (default view)

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

func (SampleCollection) Validate

func (mt SampleCollection) Validate() (err error)

Validate validates the SampleCollection media type instance.

type Samples

type Samples struct {
	// 作成日
	CreatedAt time.Time `form:"created_at" json:"created_at" yaml:"created_at" xml:"created_at"`
	// id
	ID int `form:"id" json:"id" yaml:"id" xml:"id"`
	// 名前
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// 更新日
	UpdatedAt time.Time `form:"updated_at" json:"updated_at" yaml:"updated_at" xml:"updated_at"`
}

sample list (default view)

Identifier: application/vnd.samples+json; view=default

func (*Samples) Validate

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

Validate validates the Samples media type instance.

type SamplesCollection

type SamplesCollection []*Samples

SamplesCollection is the media type for an array of Samples (default view)

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

func (SamplesCollection) Validate

func (mt SamplesCollection) Validate() (err error)

Validate validates the SamplesCollection media type instance.

type UpdateSamplesPayload

type UpdateSamplesPayload struct {
	// detail of sample
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// name of sample
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
}

UpdateSamplesPayload is the samples update action payload.

Jump to

Keyboard shortcuts

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