demo

package
v0.0.0-...-38fd44a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

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

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

func NewRandEndpoint(s Service) goa.Endpoint

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

type Client struct {
	RandEndpoint goa.Endpoint
}

Client is the "demo" service client.

func NewClient

func NewClient(rand goa.Endpoint) *Client

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

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

type Endpoints struct {
	Rand goa.Endpoint
}

Endpoints wraps the "demo" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "demo" service endpoints.

type RandPayload

type RandPayload struct {
	Min *int64
	Max *int64
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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