Skip to content

Commit

Permalink
feat(cache): improve md (#1063)
Browse files Browse the repository at this point in the history
Co-authored-by: 彭业昌 <[email protected]>
  • Loading branch information
PengYechang and 彭业昌 authored Feb 20, 2024
1 parent 07fa9b2 commit 4f50ef5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/docs/jupiter/4.9freecache.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pkg/cache 包支持多个本地缓存库,并支持metric上报
### 2 初始化实例
```go
import (
"github.com/douyu/jupiter/pkg/cache"
"github.com/douyu/jupiter/pkg/cache/xfreecache/v2"
)

Expand All @@ -62,7 +63,7 @@ type Student struct {
}

type Instance struct {
localCache *xfreecache.LocalCache[string, Student]
localCache *cache.Cache[string, Student]
}

func NewInstance() *Instance {
Expand Down Expand Up @@ -134,11 +135,12 @@ package bwlist

import (
"context"
"github.com/douyu/jupiter/pkg/cache"
"github.com/douyu/jupiter/pkg/cache/xfreecache/v2"
)

type Instance struct {
localCache *xfreecache.LocalCache[int32, []int32]
localCache *cache.Cache[int32, []int32]
}

func NewInstance() *Instance {
Expand Down

0 comments on commit 4f50ef5

Please sign in to comment.