client

package
v0.0.0-...-520f1c6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGetPayload

func BuildGetPayload(ratingGetID string, ratingGetToken string) (*rating.GetPayload, error)

BuildGetPayload builds the payload for the rating Get endpoint from CLI flags.

func BuildUpdatePayload

func BuildUpdatePayload(ratingUpdateBody string, ratingUpdateID string, ratingUpdateToken string) (*rating.UpdatePayload, error)

BuildUpdatePayload builds the payload for the rating Update endpoint from CLI flags.

func DecodeGetResponse

func DecodeGetResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeGetResponse returns a decoder for responses returned by the rating Get endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeGetResponse may return the following errors:

  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "internal-error" (type *goa.ServiceError): http.StatusInternalServerError
  • "invalid-token" (type *goa.ServiceError): http.StatusUnauthorized
  • "invalid-scopes" (type *goa.ServiceError): http.StatusForbidden
  • error: internal error

func DecodeUpdateResponse

func DecodeUpdateResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeUpdateResponse returns a decoder for responses returned by the rating Update endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeUpdateResponse may return the following errors:

  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "internal-error" (type *goa.ServiceError): http.StatusInternalServerError
  • "invalid-token" (type *goa.ServiceError): http.StatusUnauthorized
  • "invalid-scopes" (type *goa.ServiceError): http.StatusForbidden
  • error: internal error

func EncodeGetRequest

func EncodeGetRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeGetRequest returns an encoder for requests sent to the rating Get server.

func EncodeUpdateRequest

func EncodeUpdateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeUpdateRequest returns an encoder for requests sent to the rating Update server.

func GetRatingPath

func GetRatingPath(id uint) string

GetRatingPath returns the URL path to the rating service Get HTTP endpoint.

func NewGetInternalError

func NewGetInternalError(body *GetInternalErrorResponseBody) *goa.ServiceError

NewGetInternalError builds a rating service Get endpoint internal-error error.

func NewGetInvalidScopes

func NewGetInvalidScopes(body *GetInvalidScopesResponseBody) *goa.ServiceError

NewGetInvalidScopes builds a rating service Get endpoint invalid-scopes error.

func NewGetInvalidToken

func NewGetInvalidToken(body *GetInvalidTokenResponseBody) *goa.ServiceError

NewGetInvalidToken builds a rating service Get endpoint invalid-token error.

func NewGetNotFound

func NewGetNotFound(body *GetNotFoundResponseBody) *goa.ServiceError

NewGetNotFound builds a rating service Get endpoint not-found error.

func NewGetResultOK

func NewGetResultOK(body *GetResponseBody) *rating.GetResult

NewGetResultOK builds a "rating" service "Get" endpoint result from a HTTP "OK" response.

func NewUpdateInternalError

func NewUpdateInternalError(body *UpdateInternalErrorResponseBody) *goa.ServiceError

NewUpdateInternalError builds a rating service Update endpoint internal-error error.

func NewUpdateInvalidScopes

func NewUpdateInvalidScopes(body *UpdateInvalidScopesResponseBody) *goa.ServiceError

NewUpdateInvalidScopes builds a rating service Update endpoint invalid-scopes error.

func NewUpdateInvalidToken

func NewUpdateInvalidToken(body *UpdateInvalidTokenResponseBody) *goa.ServiceError

NewUpdateInvalidToken builds a rating service Update endpoint invalid-token error.

func NewUpdateNotFound

func NewUpdateNotFound(body *UpdateNotFoundResponseBody) *goa.ServiceError

NewUpdateNotFound builds a rating service Update endpoint not-found error.

func UpdateRatingPath

func UpdateRatingPath(id uint) string

UpdateRatingPath returns the URL path to the rating service Update HTTP endpoint.

func ValidateGetInternalErrorResponseBody

func ValidateGetInternalErrorResponseBody(body *GetInternalErrorResponseBody) (err error)

ValidateGetInternalErrorResponseBody runs the validations defined on Get_internal-error_Response_Body

func ValidateGetInvalidScopesResponseBody

func ValidateGetInvalidScopesResponseBody(body *GetInvalidScopesResponseBody) (err error)

ValidateGetInvalidScopesResponseBody runs the validations defined on Get_invalid-scopes_Response_Body

func ValidateGetInvalidTokenResponseBody

func ValidateGetInvalidTokenResponseBody(body *GetInvalidTokenResponseBody) (err error)

ValidateGetInvalidTokenResponseBody runs the validations defined on Get_invalid-token_Response_Body

func ValidateGetNotFoundResponseBody

func ValidateGetNotFoundResponseBody(body *GetNotFoundResponseBody) (err error)

ValidateGetNotFoundResponseBody runs the validations defined on Get_not-found_Response_Body

func ValidateGetResponseBody

func ValidateGetResponseBody(body *GetResponseBody) (err error)

ValidateGetResponseBody runs the validations defined on GetResponseBody

func ValidateUpdateInternalErrorResponseBody

func ValidateUpdateInternalErrorResponseBody(body *UpdateInternalErrorResponseBody) (err error)

ValidateUpdateInternalErrorResponseBody runs the validations defined on Update_internal-error_Response_Body

func ValidateUpdateInvalidScopesResponseBody

func ValidateUpdateInvalidScopesResponseBody(body *UpdateInvalidScopesResponseBody) (err error)

ValidateUpdateInvalidScopesResponseBody runs the validations defined on Update_invalid-scopes_Response_Body

func ValidateUpdateInvalidTokenResponseBody

func ValidateUpdateInvalidTokenResponseBody(body *UpdateInvalidTokenResponseBody) (err error)

ValidateUpdateInvalidTokenResponseBody runs the validations defined on Update_invalid-token_Response_Body

func ValidateUpdateNotFoundResponseBody

func ValidateUpdateNotFoundResponseBody(body *UpdateNotFoundResponseBody) (err error)

ValidateUpdateNotFoundResponseBody runs the validations defined on Update_not-found_Response_Body

Types

type Client

type Client struct {
	// Get Doer is the HTTP client used to make requests to the Get endpoint.
	GetDoer goahttp.Doer

	// Update Doer is the HTTP client used to make requests to the Update endpoint.
	UpdateDoer goahttp.Doer

	// CORS Doer is the HTTP client used to make requests to the  endpoint.
	CORSDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the rating service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the rating service servers.

func (*Client) BuildGetRequest

func (c *Client) BuildGetRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildGetRequest instantiates a HTTP request object with method and path set to call the "rating" service "Get" endpoint

func (*Client) BuildUpdateRequest

func (c *Client) BuildUpdateRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildUpdateRequest instantiates a HTTP request object with method and path set to call the "rating" service "Update" endpoint

func (*Client) Get

func (c *Client) Get() goa.Endpoint

Get returns an endpoint that makes HTTP requests to the rating service Get server.

func (*Client) Update

func (c *Client) Update() goa.Endpoint

Update returns an endpoint that makes HTTP requests to the rating service Update server.

type GetInternalErrorResponseBody

type GetInternalErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

GetInternalErrorResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "internal-error" error.

type GetInvalidScopesResponseBody

type GetInvalidScopesResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

GetInvalidScopesResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "invalid-scopes" error.

type GetInvalidTokenResponseBody

type GetInvalidTokenResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

GetInvalidTokenResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "invalid-token" error.

type GetNotFoundResponseBody

type GetNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

GetNotFoundResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "not-found" error.

type GetResponseBody

type GetResponseBody struct {
	// User rating for resource
	Rating *int `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"`
}

GetResponseBody is the type of the "rating" service "Get" endpoint HTTP response body.

type UpdateInternalErrorResponseBody

type UpdateInternalErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

UpdateInternalErrorResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "internal-error" error.

type UpdateInvalidScopesResponseBody

type UpdateInvalidScopesResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

UpdateInvalidScopesResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "invalid-scopes" error.

type UpdateInvalidTokenResponseBody

type UpdateInvalidTokenResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

UpdateInvalidTokenResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "invalid-token" error.

type UpdateNotFoundResponseBody

type UpdateNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

UpdateNotFoundResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "not-found" error.

type UpdateRequestBody

type UpdateRequestBody struct {
	// User rating for resource
	Rating uint `form:"rating" json:"rating" xml:"rating"`
}

UpdateRequestBody is the type of the "rating" service "Update" endpoint HTTP request body.

func NewUpdateRequestBody

func NewUpdateRequestBody(p *rating.UpdatePayload) *UpdateRequestBody

NewUpdateRequestBody builds the HTTP request body from the payload of the "Update" endpoint of the "rating" service.

Jump to

Keyboard shortcuts

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