sd

command
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package main demonstrates the service-discovery (sd) components without any external dependency (no Consul, no network):

  • sd/instance.Cache — in-memory Instancer for testing
  • sd/endpointer — wires Instancer → EndpointCache
  • sd/endpointer/balancer — lock-free RoundRobin
  • sd/endpointer/executor — Retry, RetryAlways, RetryWithCallback
  • sd.NewEndpoint — one-liner that wires everything together
  • endpoint.InvalidateOnError — cache invalidation on SD errors

Run:

go run ./examples/sd

Jump to

Keyboard shortcuts

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