Skip to content

Commit

Permalink
Merge pull request #29 from mgtv-tech/feat_redisv9
Browse files Browse the repository at this point in the history
docs: update
  • Loading branch information
daoshenzzg authored Sep 12, 2024
2 parents 9642909 + f7c73fe commit 5d72dd7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 38 deletions.
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,6 @@ type object struct {
Num int
}

func mockDBGetObject(id int) (*object, error) {
if id > 100 {
return nil, errRecordNotFound
}
return &object{Str: "mystring", Num: 42}, nil
}

func mockDBMGetObject(ids []int) (map[int]*object, error) {
ret := make(map[int]*object)
for _, id := range ids {
if id == 3 {
continue
}
ret[id] = &object{Str: "mystring", Num: id}
}
return ret, nil
}

func Example_basicUsage() {
ring := redis.NewRing(&redis.RingOptions{
Addrs: map[string]string{
Expand Down Expand Up @@ -215,6 +197,24 @@ func Example_syncLocalUsage() {
mycache.Close()
time.Sleep(time.Second)
}

func mockDBGetObject(id int) (*object, error) {
if id > 100 {
return nil, errRecordNotFound
}
return &object{Str: "mystring", Num: 42}, nil
}

func mockDBMGetObject(ids []int) (map[int]*object, error) {
ret := make(map[int]*object)
for _, id := range ids {
if id == 3 {
continue
}
ret[id] = &object{Str: "mystring", Num: id}
}
return ret, nil
}
```

## Configure settings
Expand Down Expand Up @@ -330,7 +330,10 @@ ret := mycache.MGet(ctx, key, ids, func(ctx context.Context, ids []int) (map[int

# Plugin

Plugin Project: [jetcache-go-plugin](https://github.com/mgtv-tech/jetcache-go-plugin), Welcome to contribute to this project.
Plugin Project: [jetcache-go-plugin](https://github.com/mgtv-tech/jetcache-go-plugin), Welcome to contribute to this project. Currently, the following features have been implemented:

- [Remote Adapter using go-redis v8](https://github.com/mgtv-tech/jetcache-go-plugin?tab=readme-ov-file#redisgo-redis-v8)
- [Prometheus-based Stats Handler](https://github.com/mgtv-tech/jetcache-go-plugin?tab=readme-ov-file#prometheus)

# Contributing

Expand Down
41 changes: 22 additions & 19 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ type object struct {
Num int
}

func mockDBGetObject(id int) (*object, error) {
if id > 100 {
return nil, errRecordNotFound
}
return &object{Str: "mystring", Num: 42}, nil
}

func mockDBMGetObject(ids []int) (map[int]*object, error) {
ret := make(map[int]*object)
for _, id := range ids {
if id == 3 {
continue
}
ret[id] = &object{Str: "mystring", Num: id}
}
return ret, nil
}

func Example_basicUsage() {
ring := redis.NewRing(&redis.RingOptions{
Addrs: map[string]string{
Expand Down Expand Up @@ -213,6 +195,24 @@ func Example_syncLocalUsage() {
mycache.Close()
time.Sleep(time.Second)
}

func mockDBGetObject(id int) (*object, error) {
if id > 100 {
return nil, errRecordNotFound
}
return &object{Str: "mystring", Num: 42}, nil
}

func mockDBMGetObject(ids []int) (map[int]*object, error) {
ret := make(map[int]*object)
for _, id := range ids {
if id == 3 {
continue
}
ret[id] = &object{Str: "mystring", Num: id}
}
return ret, nil
}
```

## 配置选项
Expand Down Expand Up @@ -327,7 +327,10 @@ ret := cacheT.MGet(ctx, key, ids, func(ctx context.Context, ids []int) (map[int]

# 插件

插件项目:[jetcache-go-plugin](https://github.com/mgtv-tech/jetcache-go-plugin),欢迎参与共建。
插件项目:[jetcache-go-plugin](https://github.com/mgtv-tech/jetcache-go-plugin),欢迎参与共建。目前已实现如下插件:

- [Remote Adapter using go-redis v8](https://github.com/mgtv-tech/jetcache-go-plugin?tab=readme-ov-file#redisgo-redis-v8)
- [Prometheus-based Stats Handler](https://github.com/mgtv-tech/jetcache-go-plugin?tab=readme-ov-file#prometheus)

# 贡献

Expand Down

0 comments on commit 5d72dd7

Please sign in to comment.