client

package
v0.0.0-...-a2b2d1c Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 7 Imported by: 4

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 CreateSuggestionPath

func CreateSuggestionPath() string

CreateSuggestionPath computes a request path to the create action of suggestion.

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 ListSuggestionPath

func ListSuggestionPath(showID string) string

ListSuggestionPath computes a request path to the list action of suggestion.

func LoginQuotePath

func LoginQuotePath() string

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

Types

type Client

type Client struct {
	*goaclient.Client
	BasicAuthSigner goaclient.Signer
	JWTSigner       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) CreateSuggestion

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

Create a new suggestion

func (*Client) DecodeQuote

func (c *Client) DecodeQuote(resp *http.Response) (*Quote, error)

DecodeQuote decodes the Quote instance encoded in resp body.

func (*Client) DecodeQuotes

func (c *Client) DecodeQuotes(resp *http.Response) (*Quotes, error)

DecodeQuotes decodes the Quotes instance encoded in resp body.

func (*Client) DecodeSuggestions

func (c *Client) DecodeSuggestions(resp *http.Response) (*Suggestions, error)

DecodeSuggestions decodes the Suggestions 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) ListSuggestion

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

Return all suggestions for a given show ID

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

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

NewCreateSuggestionRequest create the request corresponding to the create action endpoint of the suggestion 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) NewListSuggestionRequest

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

NewListSuggestionRequest create the request corresponding to the list action endpoint of the suggestion 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 {
	// ID of the user
	ID *int `form:"ID,omitempty" json:"ID,omitempty" xml:"ID,omitempty"`
	// User ID of quoter
	Name string `form:"Name" json:"Name" xml:"Name"`
	// The actual quotes of the quoter
	Quote string `form:"Quote" json:"Quote" xml:"Quote"`
}

CreateQuotePayload is the quote create action payload.

type CreateSuggestionPayload

type CreateSuggestionPayload struct {
	// The ID of the show
	ShowID string `form:"ShowID" json:"ShowID" xml:"ShowID"`
	// Identity of suggester
	Suggester string `form:"Suggester" json:"Suggester" xml:"Suggester"`
	// The suggested title
	Title string `form:"Title" json:"Title" xml:"Title"`
}

CreateSuggestionPayload is the suggestion create action payload.

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 (default view)

Identifier: vnd.application.io/quote; view=default

type Quotes

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

A quote from the user database (default view)

Identifier: vnd.application.io/quotes; view=default

type Suggestion

type Suggestion struct {
	// The ID of the show
	ShowID *string `form:"ShowID,omitempty" json:"ShowID,omitempty" xml:"ShowID,omitempty"`
	// Identity of suggester
	Suggester *string `form:"Suggester,omitempty" json:"Suggester,omitempty" xml:"Suggester,omitempty"`
	// The suggested title
	Title *string `form:"Title,omitempty" json:"Title,omitempty" xml:"Title,omitempty"`
}

All suggestions for a given user ID

type Suggestions

type Suggestions struct {
	// Suggestion
	Suggestions []*Suggestion `form:"Suggestions,omitempty" json:"Suggestions,omitempty" xml:"Suggestions,omitempty"`
}

Suggestions media type (default view)

Identifier: vnd.application.io/suggestions; view=default

Jump to

Keyboard shortcuts

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