client

package
v0.0.0-...-8b3e257 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMultiplyPayload

func BuildMultiplyPayload(calcMultiplyA string, calcMultiplyB string) (*calc.MultiplyPayload, error)

BuildMultiplyPayload builds the payload for the calc multiply endpoint from CLI flags.

func DecodeMultiplyResponse

func DecodeMultiplyResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

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

func MultiplyCalcPath

func MultiplyCalcPath(a int, b int) string

MultiplyCalcPath returns the URL path to the calc service multiply HTTP endpoint.

Types

type Client

type Client struct {
	// Multiply Doer is the HTTP client used to make requests to the multiply
	// endpoint.
	MultiplyDoer 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) BuildMultiplyRequest

func (c *Client) BuildMultiplyRequest(ctx context.Context, v any) (*http.Request, error)

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

func (*Client) Multiply

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

Multiply returns an endpoint that makes HTTP requests to the calc service multiply server.

Jump to

Keyboard shortcuts

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