1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/registry/cache
Jörn Friedrich Dreyer e032a6aafd
update ttl for updated nodes only (#2740)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-11-15 14:08:17 +00:00
..
cache.go update ttl for updated nodes only (#2740) 2024-11-15 14:08:17 +00:00
options.go v5 2024-06-04 21:40:43 +01:00
README.md fix: linting issues (#2566) 2022-09-30 20:32:55 +02:00

Registry Cache

Cache is a library that provides a caching layer for the go-micro registry.

If you're looking for caching in your microservices use the selector.

Interface

// Cache is the registry cache interface
type Cache interface {
	// embed the registry interface
	registry.Registry
	// stop the cache watcher
	Stop()
}

Usage

import (
	"github.com/micro/go-micro/registry"
	"github.com/micro/go-micro/registry/cache"
)

r := registry.NewRegistry()
cache := cache.New(r)

services, _ := cache.GetService("my.service")