client

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLivenessResponse

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

DecodeLivenessResponse returns a decoder for responses returned by the health Liveness endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeReadinessResponse

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

DecodeReadinessResponse returns a decoder for responses returned by the health Readiness endpoint. restoreBody controls whether the response body should be restored after having been read.

func LivenessHealthPath

func LivenessHealthPath() string

LivenessHealthPath returns the URL path to the health service Liveness HTTP endpoint.

func NewLivenessHealthResponseOK

func NewLivenessHealthResponseOK(body *LivenessResponseBody) *health.HealthResponse

NewLivenessHealthResponseOK builds a "health" service "Liveness" endpoint result from a HTTP "OK" response.

func NewReadinessHealthResponseOK

func NewReadinessHealthResponseOK(body *ReadinessResponseBody) *health.HealthResponse

NewReadinessHealthResponseOK builds a "health" service "Readiness" endpoint result from a HTTP "OK" response.

func ReadinessHealthPath

func ReadinessHealthPath() string

ReadinessHealthPath returns the URL path to the health service Readiness HTTP endpoint.

func ValidateLivenessResponseBody

func ValidateLivenessResponseBody(body *LivenessResponseBody) (err error)

ValidateLivenessResponseBody runs the validations defined on LivenessResponseBody

func ValidateReadinessResponseBody

func ValidateReadinessResponseBody(body *ReadinessResponseBody) (err error)

ValidateReadinessResponseBody runs the validations defined on ReadinessResponseBody

Types

type Client

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

	// Readiness Doer is the HTTP client used to make requests to the Readiness
	// endpoint.
	ReadinessDoer 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 health 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 health service servers.

func (*Client) BuildLivenessRequest

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

BuildLivenessRequest instantiates a HTTP request object with method and path set to call the "health" service "Liveness" endpoint

func (*Client) BuildReadinessRequest

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

BuildReadinessRequest instantiates a HTTP request object with method and path set to call the "health" service "Readiness" endpoint

func (*Client) Liveness

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

Liveness returns an endpoint that makes HTTP requests to the health service Liveness server.

func (*Client) Readiness

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

Readiness returns an endpoint that makes HTTP requests to the health service Readiness server.

type LivenessResponseBody

type LivenessResponseBody struct {
	// Service name.
	Service *string `form:"service,omitempty" json:"service,omitempty" xml:"service,omitempty"`
	// Status message.
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Service runtime version.
	Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"`
}

LivenessResponseBody is the type of the "health" service "Liveness" endpoint HTTP response body.

type ReadinessResponseBody

type ReadinessResponseBody struct {
	// Service name.
	Service *string `form:"service,omitempty" json:"service,omitempty" xml:"service,omitempty"`
	// Status message.
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Service runtime version.
	Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"`
}

ReadinessResponseBody is the type of the "health" service "Readiness" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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