Skip to content

Commit 2982bc4

Browse files
committed
refactor: move sentinel package to internal directory
Move the sentinel error definitions package from the root level to the internal directory to indicate it's intended for internal use only. This follows Go's internal package convention and prevents external packages from depending on these error definitions directly. Changes: - Move sentinel/sentinel.go to internal/sentinel/sentinel.go - Update all import statements across the codebase - Maintain existing API and functionality unchanged This change improves package organization by clearly marking the sentinel package as internal implementation detail while preserving all existing functionality and error handling behavior.
1 parent 71e00b2 commit 2982bc4

18 files changed

Lines changed: 17 additions & 17 deletions

backend/inmemory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
cache "github.com/hyp3rd/hypercache/cache/v4"
88
"github.com/hyp3rd/hypercache/internal/constants"
9-
"github.com/hyp3rd/hypercache/sentinel"
9+
"github.com/hyp3rd/hypercache/internal/sentinel"
1010
"github.com/hyp3rd/hypercache/types"
1111
)
1212

backend/redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/hyp3rd/ewrap"
1111

1212
"github.com/hyp3rd/hypercache/internal/constants"
13+
"github.com/hyp3rd/hypercache/internal/sentinel"
1314
"github.com/hyp3rd/hypercache/libs/serializer"
14-
"github.com/hyp3rd/hypercache/sentinel"
1515
"github.com/hyp3rd/hypercache/types"
1616
)
1717

eviction/arc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package eviction
99
import (
1010
"sync"
1111

12-
"github.com/hyp3rd/hypercache/sentinel"
12+
"github.com/hyp3rd/hypercache/internal/sentinel"
1313
"github.com/hyp3rd/hypercache/types"
1414
)
1515

eviction/cawolfu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"sync"
77

88
"github.com/hyp3rd/hypercache/cache"
9-
"github.com/hyp3rd/hypercache/sentinel"
9+
"github.com/hyp3rd/hypercache/internal/sentinel"
1010
)
1111

1212
// CAWOLFU is an eviction algorithm that uses the Cache-Aware Write-Optimized LFU (CAWOLFU) policy to select items for eviction.

eviction/clock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package eviction
99
import (
1010
"sync"
1111

12-
"github.com/hyp3rd/hypercache/sentinel"
12+
"github.com/hyp3rd/hypercache/internal/sentinel"
1313
"github.com/hyp3rd/hypercache/types"
1414
)
1515

eviction/eviction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/hyp3rd/ewrap"
77

8-
"github.com/hyp3rd/hypercache/sentinel"
8+
"github.com/hyp3rd/hypercache/internal/sentinel"
99
)
1010

1111
// IAlgorithm is the interface that must be implemented by eviction algorithms.

eviction/lfu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"container/heap"
77
"sync"
88

9-
"github.com/hyp3rd/hypercache/sentinel"
9+
"github.com/hyp3rd/hypercache/internal/sentinel"
1010
)
1111

1212
// LFUAlgorithm is an eviction algorithm that uses the Least Frequently Used (LFU) policy to select items for eviction.

eviction/lru.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package eviction
1313
import (
1414
"sync"
1515

16-
"github.com/hyp3rd/hypercache/sentinel"
16+
"github.com/hyp3rd/hypercache/internal/sentinel"
1717
)
1818

1919
// lruCacheItem represents an item in the LRU cache.

factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package hypercache
33
import (
44
"github.com/hyp3rd/hypercache/backend"
55
"github.com/hyp3rd/hypercache/internal/constants"
6-
"github.com/hyp3rd/hypercache/sentinel"
6+
"github.com/hyp3rd/hypercache/internal/sentinel"
77
)
88

99
// IBackendConstructor is an interface for backend constructors.

hypercache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/hyp3rd/hypercache/backend"
2020
"github.com/hyp3rd/hypercache/eviction"
2121
"github.com/hyp3rd/hypercache/internal/constants"
22-
"github.com/hyp3rd/hypercache/sentinel"
22+
"github.com/hyp3rd/hypercache/internal/sentinel"
2323
"github.com/hyp3rd/hypercache/stats"
2424
"github.com/hyp3rd/hypercache/types"
2525
"github.com/hyp3rd/hypercache/utils"

0 commit comments

Comments
 (0)