Skip to content

Commit

Permalink
objcache.TryGet
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Apr 11, 2020
1 parent 14ad20e commit 6a6c8b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions objcache/objcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ func (g *Group) Get(ctx Context, key Key) (val Value, err error) {
return
}

// TryGet func.
func (g *Group) TryGet(key Key) (val Value, ok bool) {
return g.mainCache.get(key)
}

// CacheStats returns stats about the provided cache within the group.
func (g *Group) CacheStats() CacheStats {
return g.mainCache.stats()
Expand Down

0 comments on commit 6a6c8b7

Please sign in to comment.