Documentation ¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func NewGetEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewRandomFactsEndpoint(s Service) goa.Endpoint
- type Client
- type Creature
- type Endpoints
- type GetPayload
- type GetResult
- type ListResult
- type RandomFactsPayload
- type RandomFactsResult
- type Service
Constants ¶
const ServiceName = "creatures"
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 = [3]string{"list", "get", "random-facts"}
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 MakeBadRequest ¶
func MakeBadRequest(err error) *goa.ServiceError
MakeBadRequest builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "get" of service "creatures".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "creatures".
func NewRandomFactsEndpoint ¶
NewRandomFactsEndpoint returns an endpoint function that calls the method "random-facts" of service "creatures".
Types ¶
type Client ¶
type Client struct { ListEndpoint goa.Endpoint GetEndpoint goa.Endpoint RandomFactsEndpoint goa.Endpoint }
Client is the "creatures" service client.
func (*Client) List ¶
func (c *Client) List(ctx context.Context) (res *ListResult, err error)
List calls the "list" endpoint of the "creatures" service.
func (*Client) RandomFacts ¶
func (c *Client) RandomFacts(ctx context.Context, p *RandomFactsPayload) (res *RandomFactsResult, err error)
RandomFacts calls the "random-facts" endpoint of the "creatures" service.
type Endpoints ¶
Endpoints wraps the "creatures" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "creatures" service with endpoints.
type GetPayload ¶
type GetPayload struct { // Name of the creature Name string }
GetPayload is the payload type of the creatures service get method.
type GetResult ¶
type GetResult struct { // The creature Creature *Creature }
GetResult is the result type of the creatures service get method.
type ListResult ¶
type ListResult struct { // List of creatures Creatures []*Creature }
ListResult is the result type of the creatures service list method.
type RandomFactsPayload ¶
type RandomFactsPayload struct { // Name of the creature Name string // Number of random facts N *int }
RandomFactsPayload is the payload type of the creatures service random-facts method.
type RandomFactsResult ¶
type RandomFactsResult struct { // Random facts about the creature Facts []string }
RandomFactsResult is the result type of the creatures service random-facts method.
type Service ¶
type Service interface { // List implements list. List(context.Context) (res *ListResult, err error) // Get implements get. Get(context.Context, *GetPayload) (res *GetResult, err error) // RandomFacts implements random-facts. RandomFacts(context.Context, *RandomFactsPayload) (res *RandomFactsResult, err error) }
The creatures service provides you with farm creatures and facts about them.