Skip to content

Commit

Permalink
feat: use custom store (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
scorix authored Dec 11, 2024
1 parent 7bc2343 commit ef7e12e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/grib2/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ func NewSimplePackingMessageReaderFromMessage(r io.ReaderAt, m IndexedMessage, o

type SimplePackingMessageReaderOptions func(r *simplePackingMessageReader)

func WithBoundaryCache(minLat, maxLat, minLon, maxLon float32) SimplePackingMessageReaderOptions {
func WithBoundaryCache(minLat, maxLat, minLon, maxLon float32, store cache.Store) SimplePackingMessageReaderOptions {
return func(r *simplePackingMessageReader) {
r.cache = cache.NewBoundary(minLat, maxLat, minLon, maxLon, r.spr, cache.NewMapStore())
r.cache = cache.NewBoundary(minLat, maxLat, minLon, maxLon, r.spr, store)
}
}

func WithCustomCacheStrategy(inCache func(lat, lon float32) bool) SimplePackingMessageReaderOptions {
func WithCustomCacheStrategy(inCache func(lat, lon float32) bool, store cache.Store) SimplePackingMessageReaderOptions {
return func(r *simplePackingMessageReader) {
r.cache = cache.NewCustom(inCache, r.spr, cache.NewMapStore())
r.cache = cache.NewCustom(inCache, r.spr, store)
}
}

Expand Down

0 comments on commit ef7e12e

Please sign in to comment.