diff --git a/circuitbreaker/sre/sre.go b/circuitbreaker/sre/sre.go index 7c71be8..64c0caa 100644 --- a/circuitbreaker/sre/sre.go +++ b/circuitbreaker/sre/sre.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-kratos/aegis/circuitbreaker" - "github.com/go-kratos/aegis/pkg/window" + "github.com/go-kratos/aegis/internal/window" ) // Option is sre breaker option function. diff --git a/circuitbreaker/sre/sre_test.go b/circuitbreaker/sre/sre_test.go index b021828..28d6c9f 100644 --- a/circuitbreaker/sre/sre_test.go +++ b/circuitbreaker/sre/sre_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/go-kratos/aegis/pkg/window" + "github.com/go-kratos/aegis/internal/window" "github.com/stretchr/testify/assert" ) diff --git a/consistent/consistent.go b/internal/consistent/consistent.go similarity index 100% rename from consistent/consistent.go rename to internal/consistent/consistent.go diff --git a/consistent/consistent_test.go b/internal/consistent/consistent_test.go similarity index 100% rename from consistent/consistent_test.go rename to internal/consistent/consistent_test.go diff --git a/pkg/cpu/cgroup.go b/internal/cpu/cgroup.go similarity index 100% rename from pkg/cpu/cgroup.go rename to internal/cpu/cgroup.go diff --git a/pkg/cpu/cgroup_cpu.go b/internal/cpu/cgroup_cpu.go similarity index 100% rename from pkg/cpu/cgroup_cpu.go rename to internal/cpu/cgroup_cpu.go diff --git a/pkg/cpu/psutil_cpu.go b/internal/cpu/psutil_cpu.go similarity index 100% rename from pkg/cpu/psutil_cpu.go rename to internal/cpu/psutil_cpu.go diff --git a/pkg/cpu/stat.go b/internal/cpu/stat.go similarity index 100% rename from pkg/cpu/stat.go rename to internal/cpu/stat.go diff --git a/pkg/cpu/stat_test.go b/internal/cpu/stat_test.go similarity index 89% rename from pkg/cpu/stat_test.go rename to internal/cpu/stat_test.go index ed27830..9069c38 100644 --- a/pkg/cpu/stat_test.go +++ b/internal/cpu/stat_test.go @@ -8,7 +8,8 @@ import ( ) func TestStat(t *testing.T) { - time.Sleep(time.Second * 2) + time.Sleep(time.Second * 3) + var s Stat var i Info ReadStat(&s) diff --git a/pkg/cpu/utils.go b/internal/cpu/utils.go similarity index 100% rename from pkg/cpu/utils.go rename to internal/cpu/utils.go diff --git a/pkg/minheap/minheap.go b/internal/minheap/minheap.go similarity index 100% rename from pkg/minheap/minheap.go rename to internal/minheap/minheap.go diff --git a/pkg/window/counter.go b/internal/window/counter.go similarity index 100% rename from pkg/window/counter.go rename to internal/window/counter.go diff --git a/pkg/window/counter_test.go b/internal/window/counter_test.go similarity index 100% rename from pkg/window/counter_test.go rename to internal/window/counter_test.go diff --git a/pkg/window/iterator.go b/internal/window/iterator.go similarity index 100% rename from pkg/window/iterator.go rename to internal/window/iterator.go diff --git a/pkg/window/policy.go b/internal/window/policy.go similarity index 100% rename from pkg/window/policy.go rename to internal/window/policy.go diff --git a/pkg/window/policy_test.go b/internal/window/policy_test.go similarity index 100% rename from pkg/window/policy_test.go rename to internal/window/policy_test.go diff --git a/pkg/window/reduce.go b/internal/window/reduce.go similarity index 100% rename from pkg/window/reduce.go rename to internal/window/reduce.go diff --git a/pkg/window/window.go b/internal/window/window.go similarity index 100% rename from pkg/window/window.go rename to internal/window/window.go diff --git a/pkg/window/window_test.go b/internal/window/window_test.go similarity index 100% rename from pkg/window/window_test.go rename to internal/window/window_test.go diff --git a/ratelimit/bbr/bbr.go b/ratelimit/bbr/bbr.go index c05ea43..2d76216 100644 --- a/ratelimit/bbr/bbr.go +++ b/ratelimit/bbr/bbr.go @@ -6,8 +6,8 @@ import ( "sync/atomic" "time" - "github.com/go-kratos/aegis/pkg/cpu" - "github.com/go-kratos/aegis/pkg/window" + "github.com/go-kratos/aegis/internal/cpu" + "github.com/go-kratos/aegis/internal/window" "github.com/go-kratos/aegis/ratelimit" ) diff --git a/ratelimit/bbr/bbr_test.go b/ratelimit/bbr/bbr_test.go index 47ec712..13cf262 100644 --- a/ratelimit/bbr/bbr_test.go +++ b/ratelimit/bbr/bbr_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/go-kratos/aegis/pkg/window" + "github.com/go-kratos/aegis/internal/window" "github.com/go-kratos/aegis/ratelimit" "github.com/stretchr/testify/assert" ) diff --git a/subset/subset.go b/subset/subset.go index 3f909ba..c582457 100644 --- a/subset/subset.go +++ b/subset/subset.go @@ -1,7 +1,7 @@ package subset import ( - "github.com/go-kratos/aegis/consistent" + "github.com/go-kratos/aegis/internal/consistent" ) func Subset[M consistent.Member](selectKey string, inss []M, num int) []M { diff --git a/subset/subset_test.go b/subset/subset_test.go index 4a2af74..c1c2223 100644 --- a/subset/subset_test.go +++ b/subset/subset_test.go @@ -6,7 +6,7 @@ import ( "math/rand" "testing" - "github.com/go-kratos/aegis/consistent" + "github.com/go-kratos/aegis/internal/consistent" "github.com/google/uuid" "github.com/stretchr/testify/assert" ) diff --git a/topk/heavykeeper.go b/topk/heavykeeper.go index 54ac8a1..0042ea0 100644 --- a/topk/heavykeeper.go +++ b/topk/heavykeeper.go @@ -7,7 +7,7 @@ import ( "math" "math/rand" - "github.com/go-kratos/aegis/pkg/minheap" + "github.com/go-kratos/aegis/internal/minheap" "github.com/twmb/murmur3" )