TUN-4342: Fix false positive warning about unused hostname property

This commit is contained in:
Nuno Diegues
2021-05-10 16:17:21 +01:00
committed by Areg Harutyunyan
parent bc54a7f87b
commit ae460b340b
4 changed files with 16 additions and 5 deletions

View File

@@ -72,6 +72,7 @@ type Route interface {
json.Marshaler
RecordType() string
UnmarshalResult(body io.Reader) (RouteResult, error)
String() string
}
type RouteResult interface {
@@ -116,6 +117,10 @@ func (dr *DNSRoute) RecordType() string {
return "dns"
}
func (dr *DNSRoute) String() string {
return fmt.Sprintf("%s %s", dr.RecordType(), dr.userHostname)
}
func (res *DNSRouteResult) SuccessSummary() string {
var msgFmt string
switch res.CName {
@@ -164,6 +169,10 @@ func (lr *LBRoute) RecordType() string {
return "lb"
}
func (lb *LBRoute) String() string {
return fmt.Sprintf("%s %s %s", lb.RecordType(), lb.lbName, lb.lbPool)
}
func (lr *LBRoute) UnmarshalResult(body io.Reader) (RouteResult, error) {
var result LBRouteResult
err := parseResponse(body, &result)