mirror of https://github.com/mpolden/echoip
feat(ipstack): added currency module to IP Stack response for parser
This commit is contained in:
parent
082dedcac7
commit
cf59e4401a
|
@ -48,6 +48,7 @@ func (ips *IPStack) Parse(ip net.IP, hostname string) (parser.Response, error) {
|
||||||
ips.ParseTimezoneResponse(&parserResponse)
|
ips.ParseTimezoneResponse(&parserResponse)
|
||||||
ips.ParseLocationResponse(&parserResponse)
|
ips.ParseLocationResponse(&parserResponse)
|
||||||
ips.ParseConnectionResponse(&parserResponse)
|
ips.ParseConnectionResponse(&parserResponse)
|
||||||
|
ips.ParseCurrencyResponse(&parserResponse)
|
||||||
|
|
||||||
return parserResponse, nil
|
return parserResponse, nil
|
||||||
}
|
}
|
||||||
|
@ -116,6 +117,18 @@ func (ips *IPStack) ParseConnectionResponse(parserResponse *parser.Response) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ips *IPStack) ParseCurrencyResponse(parserResponse *parser.Response) {
|
||||||
|
if ips.response.Currency != nil {
|
||||||
|
parserResponse.Currency = parser.Currency{
|
||||||
|
Code: parserResponse.Currency.Code,
|
||||||
|
Name: parserResponse.Currency.Name,
|
||||||
|
Plural: parserResponse.Currency.Plural,
|
||||||
|
Symbol: parserResponse.Currency.Symbol,
|
||||||
|
SymbolNative: parserResponse.Currency.SymbolNative,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (ips *IPStack) IsEmpty() bool {
|
func (ips *IPStack) IsEmpty() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue