Vasiliy Tolstov
1fbc056dd4
* server: minimize allocations on re-register Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: stop old instance before Init() Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * client/grpc: fix allocations in protobuf marshal Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * codec/json: fix allocations in protobuf marshal Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * remove stop from init Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * codec/grpc: expose MaxMessageSize Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * codec: use buffer pool Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * metadata: minimize reallocations Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * util/wrapper: use metadata helper Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * registry/cache: move logs to debug level Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: move logs to debug level Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: cache service only when Advertise is ip addr Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: use metadata.Copy Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> |
||
---|---|---|
.. | ||
cache.go | ||
options.go | ||
README.md |
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")