words

package
v0.0.0-...-252d4e6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "word-of-wisdom"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "1.0"

APIVersion is the version of the API as defined in the design.

View Source
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

View Source
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

func NewRequestEndpoint(s Service) goa.Endpoint

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

func NewWordsEndpoint(s Service) goa.Endpoint

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

type Client struct {
	WordsEndpoint   goa.Endpoint
	RequestEndpoint goa.Endpoint
}

Client is the "words" service client.

func NewClient

func NewClient(words, request goa.Endpoint) *Client

NewClient initializes a "words" service client given the endpoints.

func (*Client) Request

func (c *Client) Request(ctx context.Context) (res *WordsTask, err error)

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

type Endpoints struct {
	Words   goa.Endpoint
	Request goa.Endpoint
}

Endpoints wraps the "words" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "words" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "words" service 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

type WordsTask struct {
	// Previous hash
	Hash *string
	// Target difficulty
	Difficulty *int
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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