Skip to content

Commit

Permalink
README.md: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jahnestacado committed Jun 18, 2024
1 parent 22a732f commit c2192c4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ cache := tlru.New(config)
entry1 := tlru.Entry{Key:"entry-1", Value: 1, Timestamp: ingestionTimestamp1}
entry2 := tlru.Entry{Key:"entry-2", Value: 2, Timestamp: ingestionTimestamp2}

cache.Set(entry1)
cache.Set(entry2)
cache.Set(entry1.Key, entry.Value)
cache.Set(entry2.Key, entry.Value)

```

Expand All @@ -249,10 +249,12 @@ cache.Set(entry2)
TLRU provides two methods which allows cache state extraction and state rehydration

```go

config := tlru.Config[string, int]{
TTL: ttl,
}
cache := tlru.New(config)
cache.Set(entry1)
cache.Set(entry2)
cache.Set(entry1.Key, entry.Value)
cache.Set(entry2.Key, entry.Value)

// ...
// State extraction
Expand Down

0 comments on commit c2192c4

Please sign in to comment.