Update README.md
This commit is contained in:
parent
820afc49eb
commit
44414a252f
12
README.md
12
README.md
@ -19,13 +19,11 @@ type Cache interface {
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import "github.com/micro/go-micro/registry/cache"
|
||||||
"github.com/micro/go-micro/registry"
|
|
||||||
"github.com/micro/go-micro/registry/cache"
|
|
||||||
)
|
|
||||||
|
|
||||||
r := registry.NewRegistry()
|
# create a new cache
|
||||||
cache := cache.New(r)
|
c := cache.New(registry)
|
||||||
|
|
||||||
services, _ := cache.GetService("my.service")
|
# get a service from the cache
|
||||||
|
services, _ := c.GetService("helloworld")
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user