mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Use ptr receiver in all Upstream methods
This commit is contained in:
parent
6af9a0d8cf
commit
6814e84459
@ -503,15 +503,24 @@ func (u *Upstream) ToKey() UpstreamKey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u Upstream) HasLocalPortOrSocket() bool {
|
func (u *Upstream) HasLocalPortOrSocket() bool {
|
||||||
|
if u == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return (u.LocalBindPort != 0 || u.LocalBindSocketPath != "")
|
return (u.LocalBindPort != 0 || u.LocalBindSocketPath != "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u Upstream) UpstreamIsUnixSocket() bool {
|
func (u *Upstream) UpstreamIsUnixSocket() bool {
|
||||||
|
if u == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return (u.LocalBindPort == 0 && u.LocalBindAddress == "" && u.LocalBindSocketPath != "")
|
return (u.LocalBindPort == 0 && u.LocalBindAddress == "" && u.LocalBindSocketPath != "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u Upstream) UpstreamAddressToString() string {
|
func (u *Upstream) UpstreamAddressToString() string {
|
||||||
|
if u == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
if u.UpstreamIsUnixSocket() {
|
if u.UpstreamIsUnixSocket() {
|
||||||
return u.LocalBindSocketPath
|
return u.LocalBindSocketPath
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user