client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExportPayload

func BuildExportPayload(infohubExportExportName string) (*infohub.ExportRequest, error)

BuildExportPayload builds the payload for the infohub Export endpoint from CLI flags.

func BuildImportPayload

func BuildImportPayload(infohubImportBody string) (*infohub.ImportRequest, error)

BuildImportPayload builds the payload for the infohub Import endpoint from CLI flags.

func DecodeExportResponse

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

DecodeExportResponse returns a decoder for responses returned by the infohub Export endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeImportResponse

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

DecodeImportResponse returns a decoder for responses returned by the infohub Import endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeImportRequest

func EncodeImportRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeImportRequest returns an encoder for requests sent to the infohub Import server.

func ExportInfohubPath

func ExportInfohubPath(exportName string) string

ExportInfohubPath returns the URL path to the infohub service Export HTTP endpoint.

func ImportInfohubPath

func ImportInfohubPath() string

ImportInfohubPath returns the URL path to the infohub service Import HTTP endpoint.

func NewImportResultOK

func NewImportResultOK(body *ImportResponseBody) *infohub.ImportResult

NewImportResultOK builds a "infohub" service "Import" endpoint result from a HTTP "OK" response.

func ValidateImportResponseBody

func ValidateImportResponseBody(body *ImportResponseBody) (err error)

ValidateImportResponseBody runs the validations defined on ImportResponseBody

Types

type Client

type Client struct {
	// Export Doer is the HTTP client used to make requests to the Export endpoint.
	ExportDoer goahttp.Doer

	// Import Doer is the HTTP client used to make requests to the Import endpoint.
	ImportDoer 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 infohub 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 infohub service servers.

func (*Client) BuildExportRequest

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

BuildExportRequest instantiates a HTTP request object with method and path set to call the "infohub" service "Export" endpoint

func (*Client) BuildImportRequest

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

BuildImportRequest instantiates a HTTP request object with method and path set to call the "infohub" service "Import" endpoint

func (*Client) Export

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

Export returns an endpoint that makes HTTP requests to the infohub service Export server.

func (*Client) Import

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

Import returns an endpoint that makes HTTP requests to the infohub service Import server.

type ImportResponseBody

type ImportResponseBody struct {
	// importIds is an array of unique identifiers used as Cache keys to retrieve
	// the imported data entries later.
	ImportIds []string `form:"importIds,omitempty" json:"importIds,omitempty" xml:"importIds,omitempty"`
}

ImportResponseBody is the type of the "infohub" service "Import" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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