mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-17 06:23:32 +02:00
Refactor lookup methods
This commit is contained in:
@ -60,7 +60,7 @@ $ wget -qO- ifconfig.co
|
||||
$ fetch -qo- http://ifconfig.co
|
||||
{{ .IP }}
|
||||
</pre>
|
||||
{{ if .CountryLookup }}
|
||||
{{ if .IsLookupCountryEnabled }}
|
||||
<p>Country lookup:</p>
|
||||
<pre>
|
||||
$ http ifconfig.co/country
|
||||
@ -77,8 +77,8 @@ Content-Length: 61
|
||||
Content-Type: application/json
|
||||
Date: Fri, 15 Apr 2016 17:26:53 GMT
|
||||
|
||||
{ {{ if .CountryLookup }}
|
||||
"country": "{{ .Country }}",{{ end }}{{ if .ReverseLookup }}
|
||||
{ {{ if .IsLookupCountryEnabled }}
|
||||
"country": "{{ .Country }}",{{ end }}{{ if .IsLookupAddrEnabled }}
|
||||
"hostname": "{{ .Hostname }}",{{ end }}
|
||||
"ip": "{{ .IP }}"
|
||||
}
|
||||
@ -86,7 +86,7 @@ Date: Fri, 15 Apr 2016 17:26:53 GMT
|
||||
# or set Accept header to application/json:
|
||||
# http --json ifconfig.co
|
||||
</pre>
|
||||
{{ if .PortTesting }}
|
||||
{{ if .IsLookupPortEnabled }}
|
||||
<p>Testing port connectivity (only supports JSON output):</p>
|
||||
<pre>
|
||||
http --json localhost:8080/port/8080
|
||||
|
Reference in New Issue
Block a user