0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-30 22:34:15 -05:00

reverseproxy: Export ipVersions type (#5648)

allows AUpstreams to be instantiated externally
This commit is contained in:
Omar Ramadan 2023-07-25 21:50:21 +03:00 committed by GitHub
parent 4df27a20c8
commit d7d16360d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1449,7 +1449,7 @@ func (u *AUpstreams) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
} }
if u.Versions == nil { if u.Versions == nil {
u.Versions = &ipVersions{} u.Versions = &IPVersions{}
} }
trueBool := true trueBool := true

View file

@ -212,7 +212,7 @@ func (sl srvLookup) isFresh() bool {
return time.Since(sl.freshness) < time.Duration(sl.srvUpstreams.Refresh) return time.Since(sl.freshness) < time.Duration(sl.srvUpstreams.Refresh)
} }
type ipVersions struct { type IPVersions struct {
IPv4 *bool `json:"ipv4,omitempty"` IPv4 *bool `json:"ipv4,omitempty"`
IPv6 *bool `json:"ipv6,omitempty"` IPv6 *bool `json:"ipv6,omitempty"`
} }
@ -247,7 +247,7 @@ type AUpstreams struct {
// The IP versions to resolve for. By default, both // The IP versions to resolve for. By default, both
// "ipv4" and "ipv6" will be enabled, which // "ipv4" and "ipv6" will be enabled, which
// correspond to A and AAAA records respectively. // correspond to A and AAAA records respectively.
Versions *ipVersions `json:"versions,omitempty"` Versions *IPVersions `json:"versions,omitempty"`
resolver *net.Resolver resolver *net.Resolver
} }