From 4024e1cb0e16bf14a8fbbf6dc0c47f1331e02c51 Mon Sep 17 00:00:00 2001 From: zhangzhiguang Date: Wed, 13 Sep 2023 16:28:30 +0800 Subject: [PATCH] docs: update --- README.md | 5 +++-- README_zh.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d11fa9..8fd3caf 100644 --- a/README.md +++ b/README.md @@ -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)) @@ -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), @@ -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. diff --git a/README_zh.md b/README_zh.md index f5ab864..d501885 100644 --- a/README_zh.md +++ b/README_zh.md @@ -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)) @@ -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), @@ -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.