locatetest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocateServer

func NewLocateServer(loc *Locator) *httptest.Server

NewLocateServer creates an httptest.Server that can respond to Locate API v2 requests. Useful for unit testing.

Types

type Locator

type Locator struct {
	Servers []string
	Err     error
}

Locator is a fake Locator interface that returns the configured Servers or Err.

func (*Locator) Nearest

func (l *Locator) Nearest(ctx context.Context, service, lat, lon string) ([]v2.Target, error)

Nearest returns the pre-configured Locator Servers or Err.

type Signer

type Signer struct{}

Signer implements the Signer interface for unit tests.

func (*Signer) Sign

func (s *Signer) Sign(cl jwt.Claims) (string, error)

Sign creates a fake signature using the given claims.

Jump to

Keyboard shortcuts

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