handler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package handler provides a client and handlers for responding to locate requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Signer

	Locator
	// contains filtered or unexported fields
}

Client contains state needed for xyz.

func NewClient

func NewClient(project string, private Signer, locator Locator) *Client

NewClient creates a new client.

func (*Client) Heartbeat

func (c *Client) Heartbeat(rw http.ResponseWriter, req *http.Request)

Heartbeat implements /v2/heartbeat requests.

func (*Client) Monitoring

func (c *Client) Monitoring(rw http.ResponseWriter, req *http.Request)

Monitoring implements /v2/monitoring requests.

func (*Client) TranslatedQuery

func (c *Client) TranslatedQuery(rw http.ResponseWriter, req *http.Request)

TranslatedQuery uses the legacy mlab-ns service for liveness as a transitional step in loading state directly.

type Locator

type Locator interface {
	Nearest(ctx context.Context, service, lat, lon string) ([]v2.Target, error)
}

Locator defines how the TranslatedQuery handler requests machines nearest to the client.

type Signer

type Signer interface {
	Sign(cl jwt.Claims) (string, error)
}

Signer defines how access tokens are signed.

Jump to

Keyboard shortcuts

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