1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-02-04 18:21:53 +02:00
Jerry 2653e7a977
update pulgin registry mod version (#2121)
* update etcd version

* update mod version

* update
2021-02-08 08:56:39 +00:00
..
2021-01-20 21:01:10 +00:00
2021-01-20 21:01:10 +00:00
2020-12-26 15:32:45 +00: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")