client

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

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

  • "internal-error" (type *goa.ServiceError): http.StatusInternalServerError
  • error: internal error

func ListCategoryPath

func ListCategoryPath() string

ListCategoryPath returns the URL path to the category service list HTTP endpoint.

func ListCategoryPath2

func ListCategoryPath2() string

ListCategoryPath2 returns the URL path to the category service list HTTP endpoint.

func NewListInternalError

func NewListInternalError(body *ListInternalErrorResponseBody) *goa.ServiceError

NewListInternalError builds a category service list endpoint internal-error error.

func NewListResultOK

func NewListResultOK(body *ListResponseBody) *category.ListResult

NewListResultOK builds a "category" service "list" endpoint result from a HTTP "OK" response.

func ValidateCategoryResponseBody

func ValidateCategoryResponseBody(body *CategoryResponseBody) (err error)

ValidateCategoryResponseBody runs the validations defined on CategoryResponseBody

func ValidateListInternalErrorResponseBody

func ValidateListInternalErrorResponseBody(body *ListInternalErrorResponseBody) (err error)

ValidateListInternalErrorResponseBody runs the validations defined on list_internal-error_response_body

func ValidateListResponseBody

func ValidateListResponseBody(body *ListResponseBody) (err error)

ValidateListResponseBody runs the validations defined on ListResponseBody

Types

type CategoryResponseBody

type CategoryResponseBody struct {
	// ID is the unique id of the category
	ID *uint `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Name of category
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
}

CategoryResponseBody is used to define fields on response body types.

type Client

type Client struct {
	// List Doer is the HTTP client used to make requests to the list endpoint.
	ListDoer 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 category 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 category service servers.

func (*Client) BuildListRequest

func (c *Client) BuildListRequest(ctx context.Context, v any) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "category" service "list" endpoint

func (*Client) List

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

List returns an endpoint that makes HTTP requests to the category service list server.

type ListInternalErrorResponseBody

type ListInternalErrorResponseBody 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"`
}

ListInternalErrorResponseBody is the type of the "category" service "list" endpoint HTTP response body for the "internal-error" error.

type ListResponseBody

type ListResponseBody struct {
	Data []*CategoryResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"`
}

ListResponseBody is the type of the "category" service "list" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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