Skip to content

Commit

Permalink
docs: fixed signature of function argument
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiant7t authored Dec 27, 2022
1 parent 458637f commit 43fd47e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TTLCache - an in-memory cache with item expiration
[#](#) TTLCache - an in-memory cache with item expiration

[![Go Reference](https://pkg.go.dev/badge/github.com/jellydator/ttlcache/v3.svg)](https://pkg.go.dev/github.com/jellydator/ttlcache/v3)
[![Build Status](https://github.com/jellydator/ttlcache/actions/workflows/go.yml/badge.svg)](https://github.com/jellydator/ttlcache/actions/workflows/go.yml)
Expand Down Expand Up @@ -100,10 +100,10 @@ func main() {
ttlcache.WithCapacity[string, string](300),
)

cache.OnInsertion(func(item *ttlcache.Item[string, string]) {
cache.OnInsertion(func(ctx context.Context, item *ttlcache.Item[string, string]) {
fmt.Println(item.Value(), item.ExpiresAt())
})
cache.OnEviction(func(reason ttlcache.EvictionReason, item *ttlcache.Item[string, string]) {
cache.OnEviction(func(ctx context.Context, reason ttlcache.EvictionReason, item *ttlcache.Item[string, string]) {
if reason == ttlcache.EvictionReasonCapacityReached {
fmt.Println(item.Key(), item.Value())
}
Expand Down

0 comments on commit 43fd47e

Please sign in to comment.