github.com/micro/go-micro/v2@v2.9.1/registry/cache/README.md (about) 1 # Registry Cache 2 3 Cache is a library that provides a caching layer for the go-micro [registry](https://godoc.org/github.com/micro/go-micro/registry#Registry). 4 5 If you're looking for caching in your microservices use the [selector](https://micro.mu/docs/fault-tolerance.html#caching-discovery). 6 7 ## Interface 8 9 ``` 10 // Cache is the registry cache interface 11 type Cache interface { 12 // embed the registry interface 13 registry.Registry 14 // stop the cache watcher 15 Stop() 16 } 17 ``` 18 19 ## Usage 20 21 ``` 22 import ( 23 "github.com/micro/go-micro/registry" 24 "github.com/micro/go-micro/registry/cache" 25 ) 26 27 r := registry.NewRegistry() 28 cache := cache.New(r) 29 30 services, _ := cache.GetService("my.service") 31 ```