client

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEmailPayload

func BuildEmailPayload(testEmailAddress string, testEmailAuth string) (*test.EmailPayload, error)

BuildEmailPayload builds the payload for the test email endpoint from CLI flags.

func BuildGetPayload

func BuildGetPayload(testGetID string) (*test.GetPayload, error)

BuildGetPayload builds the payload for the test get endpoint from CLI flags.

func DecodeEmailResponse

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

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

  • "forbidden" (type *goa.ServiceError): http.StatusForbidden
  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "bad-request" (type *goa.ServiceError): http.StatusBadRequest
  • "unauthorized" (type test.Unauthorized): http.StatusUnauthorized
  • error: internal error

func DecodeErrorResponse

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

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

  • "forbidden" (type *goa.ServiceError): http.StatusForbidden
  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "bad-request" (type *goa.ServiceError): http.StatusBadRequest
  • "unauthorized" (type test.Unauthorized): http.StatusUnauthorized
  • error: internal error

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 test get endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeGetResponse may return the following errors:

  • "forbidden" (type *goa.ServiceError): http.StatusForbidden
  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "bad-request" (type *goa.ServiceError): http.StatusBadRequest
  • "unauthorized" (type test.Unauthorized): http.StatusUnauthorized
  • error: internal error

func EmailTestPath

func EmailTestPath() string

EmailTestPath returns the URL path to the test service email HTTP endpoint.

func EncodeEmailRequest

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

EncodeEmailRequest returns an encoder for requests sent to the test email server.

func ErrorTestPath

func ErrorTestPath() string

ErrorTestPath returns the URL path to the test service error HTTP endpoint.

func GetTestPath

func GetTestPath(id int64) string

GetTestPath returns the URL path to the test service get HTTP endpoint.

func NewEmailBadRequest

func NewEmailBadRequest(body *EmailBadRequestResponseBody) *goa.ServiceError

NewEmailBadRequest builds a test service email endpoint bad-request error.

func NewEmailForbidden

func NewEmailForbidden(body *EmailForbiddenResponseBody) *goa.ServiceError

NewEmailForbidden builds a test service email endpoint forbidden error.

func NewEmailNotFound

func NewEmailNotFound(body *EmailNotFoundResponseBody) *goa.ServiceError

NewEmailNotFound builds a test service email endpoint not-found error.

func NewEmailUnauthorized

func NewEmailUnauthorized(body EmailUnauthorizedResponseBody) test.Unauthorized

NewEmailUnauthorized builds a test service email endpoint unauthorized error.

func NewErrorBadRequest

func NewErrorBadRequest(body *ErrorBadRequestResponseBody) *goa.ServiceError

NewErrorBadRequest builds a test service error endpoint bad-request error.

func NewErrorForbidden

func NewErrorForbidden(body *ErrorForbiddenResponseBody) *goa.ServiceError

NewErrorForbidden builds a test service error endpoint forbidden error.

func NewErrorNotFound

func NewErrorNotFound(body *ErrorNotFoundResponseBody) *goa.ServiceError

NewErrorNotFound builds a test service error endpoint not-found error.

func NewErrorUnauthorized

func NewErrorUnauthorized(body ErrorUnauthorizedResponseBody) test.Unauthorized

NewErrorUnauthorized builds a test service error endpoint unauthorized error.

func NewGetBadRequest

func NewGetBadRequest(body *GetBadRequestResponseBody) *goa.ServiceError

NewGetBadRequest builds a test service get endpoint bad-request error.

func NewGetForbidden

func NewGetForbidden(body *GetForbiddenResponseBody) *goa.ServiceError

NewGetForbidden builds a test service get endpoint forbidden error.

func NewGetNotFound

func NewGetNotFound(body *GetNotFoundResponseBody) *goa.ServiceError

NewGetNotFound builds a test service get endpoint not-found error.

func NewGetUnauthorized

func NewGetUnauthorized(body GetUnauthorizedResponseBody) test.Unauthorized

NewGetUnauthorized builds a test service get endpoint unauthorized error.

func ValidateEmailBadRequestResponseBody

func ValidateEmailBadRequestResponseBody(body *EmailBadRequestResponseBody) (err error)

ValidateEmailBadRequestResponseBody runs the validations defined on email_bad-request_response_body

func ValidateEmailForbiddenResponseBody

func ValidateEmailForbiddenResponseBody(body *EmailForbiddenResponseBody) (err error)

ValidateEmailForbiddenResponseBody runs the validations defined on email_forbidden_response_body

func ValidateEmailNotFoundResponseBody

func ValidateEmailNotFoundResponseBody(body *EmailNotFoundResponseBody) (err error)

ValidateEmailNotFoundResponseBody runs the validations defined on email_not-found_response_body

func ValidateErrorBadRequestResponseBody

func ValidateErrorBadRequestResponseBody(body *ErrorBadRequestResponseBody) (err error)

ValidateErrorBadRequestResponseBody runs the validations defined on error_bad-request_response_body

func ValidateErrorForbiddenResponseBody

func ValidateErrorForbiddenResponseBody(body *ErrorForbiddenResponseBody) (err error)

ValidateErrorForbiddenResponseBody runs the validations defined on error_forbidden_response_body

func ValidateErrorNotFoundResponseBody

func ValidateErrorNotFoundResponseBody(body *ErrorNotFoundResponseBody) (err error)

ValidateErrorNotFoundResponseBody runs the validations defined on error_not-found_response_body

func ValidateGetBadRequestResponseBody

func ValidateGetBadRequestResponseBody(body *GetBadRequestResponseBody) (err error)

ValidateGetBadRequestResponseBody runs the validations defined on get_bad-request_response_body

func ValidateGetForbiddenResponseBody

func ValidateGetForbiddenResponseBody(body *GetForbiddenResponseBody) (err error)

ValidateGetForbiddenResponseBody runs the validations defined on get_forbidden_response_body

func ValidateGetNotFoundResponseBody

func ValidateGetNotFoundResponseBody(body *GetNotFoundResponseBody) (err error)

ValidateGetNotFoundResponseBody runs the validations defined on get_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

	// Error Doer is the HTTP client used to make requests to the error endpoint.
	ErrorDoer goahttp.Doer

	// Email Doer is the HTTP client used to make requests to the email endpoint.
	EmailDoer 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 test 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 test service servers.

func (*Client) BuildEmailRequest

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

BuildEmailRequest instantiates a HTTP request object with method and path set to call the "test" service "email" endpoint

func (*Client) BuildErrorRequest

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

BuildErrorRequest instantiates a HTTP request object with method and path set to call the "test" service "error" endpoint

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 "test" service "get" endpoint

func (*Client) Email

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

Email returns an endpoint that makes HTTP requests to the test service email server.

func (*Client) Error

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

Error returns an endpoint that makes HTTP requests to the test service error server.

func (*Client) Get

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

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

type EmailBadRequestResponseBody

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

EmailBadRequestResponseBody is the type of the "test" service "email" endpoint HTTP response body for the "bad-request" error.

type EmailForbiddenResponseBody

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

EmailForbiddenResponseBody is the type of the "test" service "email" endpoint HTTP response body for the "forbidden" error.

type EmailNotFoundResponseBody

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

EmailNotFoundResponseBody is the type of the "test" service "email" endpoint HTTP response body for the "not-found" error.

type EmailUnauthorizedResponseBody

type EmailUnauthorizedResponseBody string

EmailUnauthorizedResponseBody is the type of the "test" service "email" endpoint HTTP response body for the "unauthorized" error.

type ErrorBadRequestResponseBody

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

ErrorBadRequestResponseBody is the type of the "test" service "error" endpoint HTTP response body for the "bad-request" error.

type ErrorForbiddenResponseBody

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

ErrorForbiddenResponseBody is the type of the "test" service "error" endpoint HTTP response body for the "forbidden" error.

type ErrorNotFoundResponseBody

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

ErrorNotFoundResponseBody is the type of the "test" service "error" endpoint HTTP response body for the "not-found" error.

type ErrorUnauthorizedResponseBody

type ErrorUnauthorizedResponseBody string

ErrorUnauthorizedResponseBody is the type of the "test" service "error" endpoint HTTP response body for the "unauthorized" error.

type GetBadRequestResponseBody

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

GetBadRequestResponseBody is the type of the "test" service "get" endpoint HTTP response body for the "bad-request" error.

type GetForbiddenResponseBody

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

GetForbiddenResponseBody is the type of the "test" service "get" endpoint HTTP response body for the "forbidden" 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 "test" service "get" endpoint HTTP response body for the "not-found" error.

type GetUnauthorizedResponseBody

type GetUnauthorizedResponseBody string

GetUnauthorizedResponseBody is the type of the "test" service "get" endpoint HTTP response body for the "unauthorized" error.

Jump to

Keyboard shortcuts

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