1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/plugins/registry/cache
2021-10-12 13:22:08 +01:00
..
cache.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
go.mod use 4.1.0 2021-10-12 13:22:08 +01:00
go.sum 1.fix plugins go get bug. (#2187) 2021-06-30 07:21:03 +01:00
options.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
README.md add all the plugins 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")