health

package
v2.0.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MIT 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 = [1]string{"show"}

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 NewShowEndpoint

func NewShowEndpoint(s Service) endpoint.Endpoint

NewShowEndpoint returns an endpoint function that calls the method "show" of service "health".

Types

type Client

type Client struct {
	ShowEndpoint endpoint.Endpoint
}

Client is the "health" service client.

func NewClient

func NewClient(show endpoint.Endpoint) *Client

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

func (*Client) Show

func (c *Client) Show(ctx context.Context) (res string, err error)

Show calls the "show" endpoint of the "health" service.

type Endpoints

type Endpoints struct {
	Show endpoint.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(endpoint.Endpoint) endpoint.Endpoint)

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

type Service

type Service interface {
	// Health check endpoint
	Show(context.Context) (res string, err error)
}

Service is the health service interface.

Jump to

Keyboard shortcuts

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