File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ import (
2020 "strconv"
2121 "time"
2222
23- "github.com/gin-gonic/gin"
2423 "github.com/1mb-dev/obcache-go/v2/pkg/obcache"
24+ "github.com/gin-gonic/gin"
2525)
2626
2727// User represents a user profile
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import (
88 "net/http"
99 "time"
1010
11+ "github.com/1mb-dev/obcache-go/v2/pkg/obcache"
1112 "github.com/prometheus/client_golang/prometheus"
1213 "github.com/prometheus/client_golang/prometheus/promauto"
1314 "github.com/prometheus/client_golang/prometheus/promhttp"
14- "github.com/1mb-dev/obcache-go/v2/pkg/obcache"
1515)
1616
1717// Prometheus metrics
Original file line number Diff line number Diff line change 66 "log"
77 "time"
88
9- "github.com/redis/go-redis/v9"
109 "github.com/1mb-dev/obcache-go/v2/pkg/obcache"
10+ "github.com/redis/go-redis/v9"
1111)
1212
1313// User represents a simple user struct
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ package eviction
33import (
44 "sync"
55
6- lru "github.com/hashicorp/golang-lru/v2"
76 "github.com/1mb-dev/obcache-go/v2/internal/entry"
7+ lru "github.com/hashicorp/golang-lru/v2"
88)
99
1010// LRUStrategy implements the LRU (Least Recently Used) eviction strategy
Original file line number Diff line number Diff line change @@ -359,9 +359,9 @@ func TestDecompressAndDeserialize(t *testing.T) {
359359
360360func TestRoundTrip (t * testing.T ) {
361361 type ComplexData struct {
362- ID int `json:"id"`
363- Name string `json:"name"`
364- Tags []string `json:"tags"`
362+ ID int `json:"id"`
363+ Name string `json:"name"`
364+ Tags []string `json:"tags"`
365365 Metadata map [string ]string `json:"metadata"`
366366 }
367367
Original file line number Diff line number Diff line change 202202// - Use hooks judiciously to avoid performance overhead
203203// - Monitor hit rates and adjust cache policies accordingly
204204// - Choose eviction strategy based on access patterns:
205- // * LRU: Good for temporal locality (recently used data)
206- // * LFU: Good for frequency patterns (popular items)
207- // * FIFO: Simple, predictable, good for time-series data
205+ // - LRU: Good for temporal locality (recently used data)
206+ // - LFU: Good for frequency patterns (popular items)
207+ // - FIFO: Simple, predictable, good for time-series data
208208//
209209// # Thread Safety
210210//
You can’t perform that action at this time.
0 commit comments