client

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHTTPMethodPayload

func BuildHTTPMethodPayload(testHTTPMethodBody string, testHTTPMethodI string) (*test.Fields, error)

BuildHTTPMethodPayload builds the payload for the test http_method endpoint from CLI flags.

func DecodeHTTPMethodResponse

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

DecodeHTTPMethodResponse returns a decoder for responses returned by the test http_method endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeHTTPMethodRequest

func EncodeHTTPMethodRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeHTTPMethodRequest returns an encoder for requests sent to the test http_method server.

func HTTPMethodTestPath

func HTTPMethodTestPath(i int) string

HTTPMethodTestPath returns the URL path to the test service http_method HTTP endpoint.

func NewHTTPMethodFieldsOK

func NewHTTPMethodFieldsOK(body *HTTPMethodResponseBody) *test.Fields

NewHTTPMethodFieldsOK builds a "test" service "http_method" endpoint result from a HTTP "OK" response.

Types

type Client

type Client struct {
	// HTTPMethod Doer is the HTTP client used to make requests to the http_method
	// endpoint.
	HTTPMethodDoer 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 test 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 test service servers.

func (*Client) BuildHTTPMethodRequest

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

BuildHTTPMethodRequest instantiates a HTTP request object with method and path set to call the "test" service "http_method" endpoint

func (*Client) HTTPMethod

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

HTTPMethod returns an endpoint that makes HTTP requests to the test service http_method server.

type HTTPMethodRequestBody

type HTTPMethodRequestBody struct {
	// String operand
	S *string `form:"s,omitempty" json:"s,omitempty" xml:"s,omitempty"`
}

HTTPMethodRequestBody is the type of the "test" service "http_method" endpoint HTTP request body.

func NewHTTPMethodRequestBody

func NewHTTPMethodRequestBody(p *test.Fields) *HTTPMethodRequestBody

NewHTTPMethodRequestBody builds the HTTP request body from the payload of the "http_method" endpoint of the "test" service.

type HTTPMethodResponseBody

type HTTPMethodResponseBody struct {
	// String operand
	S *string `form:"s,omitempty" json:"s,omitempty" xml:"s,omitempty"`
	// Int operand
	I *int `form:"i,omitempty" json:"i,omitempty" xml:"i,omitempty"`
}

HTTPMethodResponseBody is the type of the "test" service "http_method" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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