calc

package
v0.0.0-...-1b5e7b1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

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

View Source
var MethodNames = [1]string{"multiply"}

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 NewMultiplyEndpoint

func NewMultiplyEndpoint(s Service) goa.Endpoint

NewMultiplyEndpoint returns an endpoint function that calls the method "multiply" of service "calc".

func NewViewedMultiplyresponse

func NewViewedMultiplyresponse(res *Multiplyresponse, view string) *calcviews.Multiplyresponse

NewViewedMultiplyresponse initializes viewed result type Multiplyresponse from result type Multiplyresponse using the given view.

Types

type Client

type Client struct {
	MultiplyEndpoint goa.Endpoint
}

Client is the "calc" service client.

func NewClient

func NewClient(multiply goa.Endpoint) *Client

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

func (*Client) Multiply

func (c *Client) Multiply(ctx context.Context, p *MultiplyPayload) (res *Multiplyresponse, err error)

Multiply calls the "multiply" endpoint of the "calc" service.

type Endpoints

type Endpoints struct {
	Multiply 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 MultiplyPayload

type MultiplyPayload struct {
	// Left operand
	A int
	// Right operand
	B int
}

MultiplyPayload is the payload type of the calc service multiply method.

type Multiplyresponse

type Multiplyresponse struct {
	// Result of multiplication
	Multiple int
}

Multiplyresponse is the result type of the calc service multiply method.

func NewMultiplyresponse

func NewMultiplyresponse(vres *calcviews.Multiplyresponse) *Multiplyresponse

NewMultiplyresponse initializes result type Multiplyresponse from viewed result type Multiplyresponse.

type Service

type Service interface {
	// Multiply implements multiply.
	Multiply(context.Context, *MultiplyPayload) (res *Multiplyresponse, err error)
}

The calc service performs operations on numbers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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