Documentation ¶
Index ¶
- Constants
- Variables
- func NewRequestEndpoint(s Service) goa.Endpoint
- func NewViewedWordsResult(res *WordsResult, view string) *wordsviews.WordsResult
- func NewViewedWordsTask(res *WordsTask, view string) *wordsviews.WordsTask
- func NewWordsEndpoint(s Service) goa.Endpoint
- type BadRequestError
- type Client
- type ConflictError
- type Endpoints
- type ForbiddenError
- type InternalError
- type NotFoundError
- type Service
- type WordsPayload
- type WordsResult
- type WordsTask
Constants ¶
const APIName = "word-of-wisdom"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0"
APIVersion is the version of the API as defined in the design.
const ServiceName = "words"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [2]string{"words", "request"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func NewRequestEndpoint ¶
NewRequestEndpoint returns an endpoint function that calls the method "request" of service "words".
func NewViewedWordsResult ¶
func NewViewedWordsResult(res *WordsResult, view string) *wordsviews.WordsResult
NewViewedWordsResult initializes viewed result type WordsResult from result type WordsResult using the given view.
func NewViewedWordsTask ¶
func NewViewedWordsTask(res *WordsTask, view string) *wordsviews.WordsTask
NewViewedWordsTask initializes viewed result type WordsTask from result type WordsTask using the given view.
func NewWordsEndpoint ¶
NewWordsEndpoint returns an endpoint function that calls the method "words" of service "words".
Types ¶
type BadRequestError ¶
type BadRequestError struct { // Key to select a localized message MsgCode string // Detailed error message Msg string // Message attributes Attributes any }
func (*BadRequestError) Error ¶
func (e *BadRequestError) Error() string
Error returns an error description.
func (*BadRequestError) ErrorName
deprecated
func (e *BadRequestError) ErrorName() string
ErrorName returns "BadRequestError".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*BadRequestError) GoaErrorName ¶
func (e *BadRequestError) GoaErrorName() string
GoaErrorName returns "BadRequestError".
type Client ¶
Client is the "words" service client.
func (*Client) Request ¶
Request calls the "request" endpoint of the "words" service. Request may return the following errors:
- "not_found" (type *NotFoundError): is a common error response for not found
- "bad_request" (type *BadRequestError): is a common error response for bad request
- "internal" (type *InternalError): is a common error response for internal error
- "conflict" (type *ConflictError): is a common error response for conflict error
- "forbidden" (type *ForbiddenError): is a common error response for forbidden error
- error: internal error
func (*Client) Words ¶
func (c *Client) Words(ctx context.Context, p *WordsPayload) (res *WordsResult, err error)
Words calls the "words" endpoint of the "words" service. Words may return the following errors:
- "not_found" (type *NotFoundError): is a common error response for not found
- "bad_request" (type *BadRequestError): is a common error response for bad request
- "internal" (type *InternalError): is a common error response for internal error
- "conflict" (type *ConflictError): is a common error response for conflict error
- "forbidden" (type *ForbiddenError): is a common error response for forbidden error
- error: internal error
type ConflictError ¶
type ConflictError struct { // Key to select a localized message MsgCode string // Detailed error message Msg string // Message attributes Attributes any }
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
Error returns an error description.
func (*ConflictError) ErrorName
deprecated
func (e *ConflictError) ErrorName() string
ErrorName returns "ConflictError".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*ConflictError) GoaErrorName ¶
func (e *ConflictError) GoaErrorName() string
GoaErrorName returns "ConflictError".
type Endpoints ¶
Endpoints wraps the "words" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "words" service with endpoints.
type ForbiddenError ¶
type ForbiddenError struct { // Key to select a localized message MsgCode string // Detailed error message Msg string // Message attributes Attributes any }
func (*ForbiddenError) Error ¶
func (e *ForbiddenError) Error() string
Error returns an error description.
func (*ForbiddenError) ErrorName
deprecated
func (e *ForbiddenError) ErrorName() string
ErrorName returns "ForbiddenError".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*ForbiddenError) GoaErrorName ¶
func (e *ForbiddenError) GoaErrorName() string
GoaErrorName returns "ForbiddenError".
type InternalError ¶
type InternalError struct { // Key to select a localized message MsgCode string // Detailed error message Msg string // Message attributes Attributes any }
func (*InternalError) Error ¶
func (e *InternalError) Error() string
Error returns an error description.
func (*InternalError) ErrorName
deprecated
func (e *InternalError) ErrorName() string
ErrorName returns "InternalError".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*InternalError) GoaErrorName ¶
func (e *InternalError) GoaErrorName() string
GoaErrorName returns "InternalError".
type NotFoundError ¶
type NotFoundError struct { // Key to select a localized message MsgCode string // Detailed error message Msg string // Message attributes Attributes any }
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error returns an error description.
func (*NotFoundError) ErrorName
deprecated
func (e *NotFoundError) ErrorName() string
ErrorName returns "NotFoundError".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*NotFoundError) GoaErrorName ¶
func (e *NotFoundError) GoaErrorName() string
GoaErrorName returns "NotFoundError".
type Service ¶
type Service interface { // Returns smartypents quote Words(context.Context, *WordsPayload) (res *WordsResult, err error) // First step for new quote, returns task Request(context.Context) (res *WordsTask, err error) }
Service is the words service interface.
type WordsPayload ¶
type WordsPayload struct { // Solution block Solution *string }
WordsPayload is the payload type of the words service words method.
type WordsResult ¶
type WordsResult struct { // Words of wisdome Quote *string }
WordsResult is the result type of the words service words method.
func NewWordsResult ¶
func NewWordsResult(vres *wordsviews.WordsResult) *WordsResult
NewWordsResult initializes result type WordsResult from viewed result type WordsResult.
type WordsTask ¶
WordsTask is the result type of the words service request method.
func NewWordsTask ¶
func NewWordsTask(vres *wordsviews.WordsTask) *WordsTask
NewWordsTask initializes result type WordsTask from viewed result type WordsTask.