package cache
import "github.com/go-kit/kit/sd/cache"
Index ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache collects the most recent set of endpoints from a service discovery system via a subscriber, and makes them available to consumers. Cache is meant to be embedded inside of a concrete subscriber, and can serve Service invocations directly.
func New ¶
New returns a new, empty endpoint cache.
func (*Cache) Endpoints ¶
Endpoints yields the current set of (presumably identical) endpoints, ordered lexicographically by the corresponding instance string.
func (*Cache) Update ¶
Update should be invoked by clients with a complete set of current instance strings whenever that set changes. The cache manufactures new endpoints via the factory, closes old endpoints when they disappear, and persists existing endpoints if they survive through an update.
Source Files ¶
- Version
- v0.4.0
- Published
- Mar 6, 2017
- Platform
- darwin/amd64
- Imports
- 7 packages
- Last checked
- 1 hour ago –
Tools for package owners.