client

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCalcPath

func AddCalcPath(a int, b int) string

AddCalcPath returns the URL path to the calc service add HTTP endpoint.

func BuildAddPayload

func BuildAddPayload(calcAddA string, calcAddB string) (*calc.AddPayload, error)

BuildAddPayload builds the payload for the calc add endpoint from CLI flags.

func DecodeAddResponse

func DecodeAddResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeAddResponse returns a decoder for responses returned by the calc add endpoint. restoreBody controls whether the response body should be restored after having been read.

Types

type Client

type Client struct {
	// Add Doer is the HTTP client used to make requests to the add endpoint.
	AddDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the calc service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the calc service servers.

func (*Client) Add

func (c *Client) Add() goa.Endpoint

Add returns an endpoint that makes HTTP requests to the calc service add server.

func (*Client) BuildAddRequest

func (c *Client) BuildAddRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildAddRequest instantiates a HTTP request object with method and path set to call the "calc" service "add" endpoint

Jump to

Keyboard shortcuts

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