Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocateServerV2 ¶ added in v0.11.0
NewLocateServerV2 creates an httptest.Server that can respond to Locate API V2 requests using a LocatorV2. Uselful for unit testing.
Types ¶
type LocatorV2 ¶ added in v0.11.0
type LocatorV2 struct { heartbeat.StatusTracker Servers []string Err error }
LocatorV2 is a fake LocatorV2 implementation that returns the configured Servers or Err.
func (*LocatorV2) Nearest ¶ added in v0.11.0
func (l *LocatorV2) Nearest(service string, lat, lon float64, opts *heartbeat.NearestOptions) (*heartbeat.TargetInfo, error)
Nearest returns the pre-configured LocatorV2 Servers or Err.
Click to show internal directories.
Click to hide internal directories.