Documentation ¶
Index ¶
Constants ¶
const ServiceName = "demo"
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{"rand"}
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 MakeInvalidArguments ¶
func MakeInvalidArguments(err error) *goa.ServiceError
MakeInvalidArguments builds a goa.ServiceError from an error.
func NewRandEndpoint ¶
NewRandEndpoint returns an endpoint function that calls the method "rand" of service "demo".
func NewViewedRandResult ¶
func NewViewedRandResult(res *RandResult, view string) *demoviews.RandResult
NewViewedRandResult initializes viewed result type RandResult from result type RandResult using the given view.
Types ¶
type Client ¶
Client is the "demo" service client.
func (*Client) Rand ¶
func (c *Client) Rand(ctx context.Context, p *RandPayload) (res *RandResult, err error)
Rand calls the "rand" endpoint of the "demo" service. Rand may return the following errors:
- "invalid_arguments" (type *goa.ServiceError)
- error: internal error
type Endpoints ¶
Endpoints wraps the "demo" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "demo" service with endpoints.
type RandPayload ¶
RandPayload is the payload type of the demo service rand method.
type RandResult ¶
type RandResult struct {
Result *int64
}
RandResult is the result type of the demo service rand method.
func NewRandResult ¶
func NewRandResult(vres *demoviews.RandResult) *RandResult
NewRandResult initializes result type RandResult from viewed result type RandResult.
type Service ¶
type Service interface { // Rand implements rand. Rand(context.Context, *RandPayload) (res *RandResult, err error) }
Demonstration Go Service