mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 00:29:03 +01:00
feat(config): add implement file provider validation tests
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/yusing/go-proxy/agent/pkg/certs"
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
"github.com/yusing/go-proxy/internal/logging"
|
||||
gphttp "github.com/yusing/go-proxy/internal/net/gphttp"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp"
|
||||
"github.com/yusing/go-proxy/internal/net/types"
|
||||
"github.com/yusing/go-proxy/pkg"
|
||||
)
|
||||
@@ -54,6 +54,15 @@ var (
|
||||
HTTPProxyURLPrefixLen = len(APIEndpointBase + EndpointProxyHTTP)
|
||||
)
|
||||
|
||||
// TestAgentConfig is a helper function to create an AgentConfig for testing purposes.
|
||||
// Not used in production.
|
||||
func TestAgentConfig(name string, addr string) *AgentConfig {
|
||||
return &AgentConfig{
|
||||
name: name,
|
||||
Addr: addr,
|
||||
}
|
||||
}
|
||||
|
||||
func IsDockerHostAgent(dockerHost string) bool {
|
||||
return strings.HasPrefix(dockerHost, FakeDockerHostPrefix)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user