Documentation ¶
Index ¶
Constants ¶
const APIName = "calc"
APIName is the name of the API as defined in the design.
const APIVersion = "0.0.1"
APIVersion is the version of the API as defined in the design.
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.
Functions ¶
func NewAddEndpoint ¶
NewAddEndpoint returns an endpoint function that calls the method "add" of service "calc".
Types ¶
type AddClientStream ¶ added in v3.4.0
type AddClientStream interface { // Send streams instances of "AddStreamingPayload". Send(*AddStreamingPayload) error // Recv reads instances of "int" from the stream. Recv() (int, error) // Close closes the stream. Close() error }
AddClientStream is the interface a "add" endpoint client stream must satisfy.
type AddEndpointInput ¶ added in v3.4.0
type AddEndpointInput struct { // Payload is the method payload. Payload *AddPayload // Stream is the server stream used by the "add" method to send data. Stream AddServerStream }
AddEndpointInput holds both the payload and the server stream of the "add" method.
type AddPayload ¶
AddPayload is the payload type of the calc service add method.
type AddServerStream ¶ added in v3.4.0
type AddServerStream interface { // Send streams instances of "int". Send(int) error // Recv reads instances of "AddStreamingPayload" from the stream. Recv() (*AddStreamingPayload, error) // Close closes the stream. Close() error }
AddServerStream is the interface a "add" endpoint server stream must satisfy.
type AddStreamingPayload ¶ added in v3.4.0
AddStreamingPayload is the streaming payload type of the calc service add method.
type Client ¶
Client is the "calc" service client.
func (*Client) Add ¶
func (c *Client) Add(ctx context.Context, p *AddPayload) (res AddClientStream, err error)
Add calls the "add" endpoint of the "calc" service.
type Endpoints ¶
Endpoints wraps the "calc" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "calc" service with endpoints.
type Service ¶
type Service interface { // Add implements add. Add(context.Context, *AddPayload, AddServerStream) (err error) }
The calc service performs additions on numbers