github.com/goadesign/goa/examples/calc/gen/calc
calcsvc
import "github.com/goadesign/goa/examples/calc/gen/calc"
Overview
Index
- Constants
- Variables
- func NewAddEndpoint(s Service) goa.Endpoint
- type AddPayload
- type Client
- type Endpoints
- type Service
Package files
client.go endpoints.go service.go
Constants
const ServiceName = "calc"
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 = [1]string{"add"}
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.
func NewAddEndpoint
func NewAddEndpoint(s Service) goa.Endpoint
NewAddEndpoint returns an endpoint function that calls the method “add” of service “calc”.
type AddPayload
type AddPayload struct {
// Left operand
A int
// Right operand
B int
}
AddPayload is the payload type of the calc service add method.
type Client
type Client struct {
AddEndpoint goa.Endpoint
}
Client is the “calc” service client.
func NewClient
func NewClient(add goa.Endpoint) *Client
NewClient initializes a “calc” service client given the endpoints.
func (*Client) Add
func (c *Client) Add(ctx context.Context, p *AddPayload) (res int, err error)
Add calls the “add” endpoint of the “calc” service.
type Endpoints
type Endpoints struct {
Add goa.Endpoint
}
Endpoints wraps the “calc” service endpoints.
func NewEndpoints
func NewEndpoints(s Service) *Endpoints
NewEndpoints wraps the methods of the “calc” service with endpoints.
func (*Endpoints) Use
func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)
Use applies the given middleware to all the “calc” service endpoints.
type Service
type Service interface {
// Add implements add.
Add(context.Context, *AddPayload) (res int, err error)
}
The calc service performs operations on numbers
Generated by godoc2md