client

package
v3.7.11 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCalcPath

func AddCalcPath(left int, right int) string

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

func BuildAddPayload

func BuildAddPayload(calcAddLeft string, calcAddRight 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 AddClientStream added in v3.4.0

type AddClientStream struct {
	// contains filtered or unexported fields
}

AddClientStream implements the calc.AddClientStream interface.

func (*AddClientStream) Close added in v3.4.0

func (s *AddClientStream) Close() error

Close closes the "add" endpoint websocket connection.

func (*AddClientStream) Recv added in v3.4.0

func (s *AddClientStream) Recv() (int, error)

Recv reads instances of "int" from the "add" endpoint websocket connection.

func (*AddClientStream) Send added in v3.4.0

Send streams instances of "calc.AddStreamingPayload" to the "add" endpoint websocket connection.

type AddStreamingBody added in v3.4.0

type AddStreamingBody struct {
	// Left operand
	A int `form:"a" json:"a" xml:"a"`
	// Right operand
	B int `form:"b" json:"b" xml:"b"`
}

AddStreamingBody is the type of the "calc" service "add" endpoint HTTP request body.

func NewAddStreamingBody added in v3.4.0

func NewAddStreamingBody(p *calc.AddStreamingPayload) *AddStreamingBody

NewAddStreamingBody builds the HTTP request body from the payload of the "add" endpoint of the "calc" service.

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,
	dialer goahttp.Dialer,
	cfn *ConnConfigurer,
) *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

type ConnConfigurer added in v3.4.0

type ConnConfigurer struct {
	AddFn goahttp.ConnConfigureFunc
}

ConnConfigurer holds the websocket connection configurer functions for the streaming endpoints in "calc" service.

func NewConnConfigurer added in v3.4.0

func NewConnConfigurer(fn goahttp.ConnConfigureFunc) *ConnConfigurer

NewConnConfigurer initializes the websocket connection configurer function with fn for all the streaming endpoints in "calc" service.

Jump to

Keyboard shortcuts

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