Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhiguang committed Sep 13, 2023
1 parent d8a7721 commit 4024e1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Example_basicUsage() {
},
})

mycache := cache.New("basicUsage",
mycache := cache.New(cache.WithName("any"),
cache.WithRemote(remote.NewGoRedisV8Adaptor(ring)),
cache.WithLocal(local.NewFreeCache(256*local.MB, time.Minute)),
cache.WithErrNotFound(errRecordNotFound))
Expand Down Expand Up @@ -108,7 +108,7 @@ func Example_advancedUsage() {
},
})

mycache := cache.New("advancedUsage",
mycache := cache.New(cache.WithName("any"),
cache.WithRemote(remote.NewGoRedisV8Adaptor(ring)),
cache.WithLocal(local.NewFreeCache(256*local.MB, time.Minute)),
cache.WithErrNotFound(errRecordNotFound),
Expand Down Expand Up @@ -137,6 +137,7 @@ func Example_advancedUsage() {
```go
// Options are used to store cache options.
type Options struct {
name string // Cache name, used for log identification and metric reporting
remote remote.Remote // Remote cache.
local local.Local // Local cache.
codec string // Value encoding and decoding method. Default is "msgpack.Name". You can also customize it.
Expand Down
5 changes: 3 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Example_basicUsage() {
},
})

mycache := cache.New("basicUsage",
mycache := cache.New(cache.WithName("any"),
cache.WithRemote(remote.NewGoRedisV8Adaptor(ring)),
cache.WithLocal(local.NewFreeCache(256*local.MB, time.Minute)),
cache.WithErrNotFound(errRecordNotFound))
Expand Down Expand Up @@ -107,7 +107,7 @@ func Example_advancedUsage() {
},
})

mycache := cache.New("advancedUsage",
mycache := cache.New(cache.WithName("any"),
cache.WithRemote(remote.NewGoRedisV8Adaptor(ring)),
cache.WithLocal(local.NewFreeCache(256*local.MB, time.Minute)),
cache.WithErrNotFound(errRecordNotFound),
Expand Down Expand Up @@ -136,6 +136,7 @@ func Example_advancedUsage() {
```go
// Options are used to store cache options.
type Options struct {
name string // Cache name, used for log identification and metric reporting
remote remote.Remote // Remote cache.
local local.Local // Local cache.
codec string // Value encoding and decoding method. Default is "json.Name" or "msgpack.Name". You can also customize it.
Expand Down

0 comments on commit 4024e1c

Please sign in to comment.