summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Ramadan <omar.ramadan93@gmail.com>2023-07-25 21:50:21 +0300
committerGitHub <noreply@github.com>2023-07-25 12:50:21 -0600
commitd7d16360d41159a3bea772c36e795bab31503897 (patch)
treec84f44348909ae7b0283118b74e4dfc76eb1222c
parent4df27a20c8f1b16eaba11799a7e0e650950ef408 (diff)
reverseproxy: Export ipVersions type (#5648)
allows AUpstreams to be instantiated externally
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go2
-rw-r--r--modules/caddyhttp/reverseproxy/upstreams.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index 26dd55c..1d86beb 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -1449,7 +1449,7 @@ func (u *AUpstreams) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}
if u.Versions == nil {
- u.Versions = &ipVersions{}
+ u.Versions = &IPVersions{}
}
trueBool := true
diff --git a/modules/caddyhttp/reverseproxy/upstreams.go b/modules/caddyhttp/reverseproxy/upstreams.go
index 42fedb6..19e4f3c 100644
--- a/modules/caddyhttp/reverseproxy/upstreams.go
+++ b/modules/caddyhttp/reverseproxy/upstreams.go
@@ -212,7 +212,7 @@ func (sl srvLookup) isFresh() bool {
return time.Since(sl.freshness) < time.Duration(sl.srvUpstreams.Refresh)
}
-type ipVersions struct {
+type IPVersions struct {
IPv4 *bool `json:"ipv4,omitempty"`
IPv6 *bool `json:"ipv6,omitempty"`
}
@@ -247,7 +247,7 @@ type AUpstreams struct {
// The IP versions to resolve for. By default, both
// "ipv4" and "ipv6" will be enabled, which
// correspond to A and AAAA records respectively.
- Versions *ipVersions `json:"versions,omitempty"`
+ Versions *IPVersions `json:"versions,omitempty"`
resolver *net.Resolver
}