client

package
v0.0.0-...-cb628ab Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateQuotePath

func CreateQuotePath() string

CreateQuotePath computes a request path to the create action of quote.

func ListByIDQuotePath

func ListByIDQuotePath(userID string) string

ListByIDQuotePath computes a request path to the list by ID action of quote.

func ListQuotePath

func ListQuotePath() string

ListQuotePath computes a request path to the list action of quote.

func LoginQuotePath

func LoginQuotePath() string

LoginQuotePath computes a request path to the login action of quote.

Types

type Client

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

Client is the koredata service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateQuote

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

Create a quote and add it to the database

func (*Client) DecodeJSON

func (c *Client) DecodeJSON(resp *http.Response) (*JSON, error)

DecodeJSON decodes the JSON instance encoded in resp body.

func (*Client) ListByIDQuote

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

Returns all the quotes for a given person

func (*Client) ListQuote

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

Returns all quotes in the quote database

func (*Client) LoginQuote

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

Login to the api

func (*Client) NewCreateQuoteRequest

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

NewCreateQuoteRequest create the request corresponding to the create action endpoint of the quote resource.

func (*Client) NewListByIDQuoteRequest

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

NewListByIDQuoteRequest create the request corresponding to the list by ID action endpoint of the quote resource.

func (*Client) NewListQuoteRequest

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

NewListQuoteRequest create the request corresponding to the list action endpoint of the quote resource.

func (*Client) NewLoginQuoteRequest

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

NewLoginQuoteRequest create the request corresponding to the login action endpoint of the quote resource.

func (*Client) SetBasicAuthSigner

func (c *Client) SetBasicAuthSigner(signer goaclient.Signer)

SetBasicAuthSigner sets the request signer for the BasicAuth security scheme.

func (*Client) SetJWTSigner

func (c *Client) SetJWTSigner(signer goaclient.Signer)

SetJWTSigner sets the request signer for the jwt security scheme.

type CreateQuotePayload

type CreateQuotePayload struct {
	Name  string `form:"Name" json:"Name" xml:"Name"`
	Quote string `form:"Quote" json:"Quote" xml:"Quote"`
}

CreateQuotePayload is the quote create action payload.

type JSON

type JSON struct {
	// Quote
	Quotes []*Quote `form:"Quotes,omitempty" json:"Quotes,omitempty" xml:"Quotes,omitempty"`
}

A quote from the user database (default view)

Identifier: application/json; view=default

type Quote

type Quote struct {
	// ID of the user
	ID *int `form:"ID,omitempty" json:"ID,omitempty" xml:"ID,omitempty"`
	// User ID of quoter
	Name *string `form:"Name,omitempty" json:"Name,omitempty" xml:"Name,omitempty"`
	// The actual quotes of the quoter
	Quote *string `form:"Quote,omitempty" json:"Quote,omitempty" xml:"Quote,omitempty"`
}

All quotes for a given user ID

type QuotePayload

type QuotePayload struct {
	Name  *string `form:"Name,omitempty" json:"Name,omitempty" xml:"Name,omitempty"`
	Quote *string `form:"Quote,omitempty" json:"Quote,omitempty" xml:"Quote,omitempty"`
}

QuotePayload user type.

func (*QuotePayload) Validate

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

Validate validates the QuotePayload type instance.

Jump to

Keyboard shortcuts

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