From d7d16360d41159a3bea772c36e795bab31503897 Mon Sep 17 00:00:00 2001 From: Omar Ramadan Date: Tue, 25 Jul 2023 21:50:21 +0300 Subject: reverseproxy: Export ipVersions type (#5648) allows AUpstreams to be instantiated externally --- modules/caddyhttp/reverseproxy/caddyfile.go | 2 +- modules/caddyhttp/reverseproxy/upstreams.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index 26dd55c93..1d86bebd7 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 42fedb651..19e4f3cbc 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 } -- cgit v1.2.3