Skip to content

Commit

Permalink
reverseproxy: Export ipVersions type (#5648)
Browse files Browse the repository at this point in the history
allows AUpstreams to be instantiated externally
  • Loading branch information
kkroo authored Jul 25, 2023
1 parent 4df27a2 commit d7d1636
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/caddyhttp/reverseproxy/caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ func (u *AUpstreams) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}

if u.Versions == nil {
u.Versions = &ipVersions{}
u.Versions = &IPVersions{}
}

trueBool := true
Expand Down
4 changes: 2 additions & 2 deletions modules/caddyhttp/reverseproxy/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit d7d1636

Please sign in to comment.