mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 02:02:26 -04:00
reverseproxy: Export ipVersions type (#5648)
allows AUpstreams to be instantiated externally
This commit is contained in:
parent
4df27a20c8
commit
d7d16360d4
@ -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
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user