health

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0, BSD-3-Clause, MIT, + 1 more Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "health"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"Liveness", "Readiness"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewLivenessEndpoint

func NewLivenessEndpoint(s Service) goa.Endpoint

NewLivenessEndpoint returns an endpoint function that calls the method "Liveness" of service "health".

func NewReadinessEndpoint

func NewReadinessEndpoint(s Service) goa.Endpoint

NewReadinessEndpoint returns an endpoint function that calls the method "Readiness" of service "health".

Types

type Client

type Client struct {
	LivenessEndpoint  goa.Endpoint
	ReadinessEndpoint goa.Endpoint
}

Client is the "health" service client.

func NewClient

func NewClient(liveness, readiness goa.Endpoint) *Client

NewClient initializes a "health" service client given the endpoints.

func (*Client) Liveness

func (c *Client) Liveness(ctx context.Context) (res *HealthResponse, err error)

Liveness calls the "Liveness" endpoint of the "health" service.

func (*Client) Readiness

func (c *Client) Readiness(ctx context.Context) (res *HealthResponse, err error)

Readiness calls the "Readiness" endpoint of the "health" service.

type Endpoints

type Endpoints struct {
	Liveness  goa.Endpoint
	Readiness goa.Endpoint
}

Endpoints wraps the "health" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "health" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "health" service endpoints.

type HealthResponse

type HealthResponse struct {
	// Service name.
	Service string
	// Status message.
	Status string
	// Service runtime version.
	Version string
}

HealthResponse is the result type of the health service Liveness method.

type Service

type Service interface {
	// Liveness implements Liveness.
	Liveness(context.Context) (res *HealthResponse, err error)
	// Readiness implements Readiness.
	Readiness(context.Context) (res *HealthResponse, err error)
}

Health service provides health check endpoints.

Jump to

Keyboard shortcuts

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