mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 07:36:37 +08:00
refactor(pkg): merge pkg/utils into pkg/util
Consolidate pure helper packages under pkg/util and update imports.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/edge/nodeip"
|
||||
"github.com/Rain-kl/Wavelet/pkg/utils"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -147,7 +147,7 @@ func Load(path string) (*Config, error) {
|
||||
func applyDefaults(cfg *Config, baseDir string) {
|
||||
baseDir = filepath.Clean(baseDir)
|
||||
cfg.Version = Version
|
||||
cfg.OpenrestyResolvers = utils.UniqueAndCleanStringSlice(cfg.OpenrestyResolvers)
|
||||
cfg.OpenrestyResolvers = util.UniqueAndCleanStringSlice(cfg.OpenrestyResolvers)
|
||||
applyAgentIdentityDefaults(cfg)
|
||||
applyAgentPathDefaults(cfg, baseDir)
|
||||
applyAgentTimingDefaults(cfg)
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
|
||||
sharedprotocol "github.com/Rain-kl/Wavelet/pkg/protocol"
|
||||
openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty"
|
||||
"github.com/Rain-kl/Wavelet/pkg/utils"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/agent/protocol"
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/agent/runtimeuser"
|
||||
@@ -1506,7 +1506,7 @@ func ResolverDirective(explicitResolvers []string) string {
|
||||
}
|
||||
|
||||
func resolverAddresses(explicitResolvers []string) []string {
|
||||
if resolvers := utils.UniqueAndCleanStringSlice(explicitResolvers); len(resolvers) > 0 {
|
||||
if resolvers := util.UniqueAndCleanStringSlice(explicitResolvers); len(resolvers) > 0 {
|
||||
return resolvers
|
||||
}
|
||||
data, err := os.ReadFile("/etc/resolv.conf")
|
||||
|
||||
Reference in New Issue
Block a user