mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2024-12-22 08:38:01 +00:00
Tidy up the house
This commit is contained in:
parent
f7d0a679c9
commit
ab46275990
11
README.md
11
README.md
@ -3,6 +3,7 @@
|
||||
[![CI](https://github.com/dcarrillo/whatismyip/workflows/CI/badge.svg)](https://github.com/dcarrillo/whatismyip/actions)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/dcarrillo/whatismyip)](https://goreportcard.com/report/github.com/dcarrillo/whatismyip)
|
||||
[![GitHub release](https://img.shields.io/github/release/dcarrillo/whatismyip.svg)](https://github.com/dcarrillo/whatismyip/releases/)
|
||||
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](./LICENSE)
|
||||
|
||||
- [What is my IP address](#what-is-my-ip-address)
|
||||
- [Features](#features)
|
||||
@ -15,7 +16,7 @@
|
||||
- [Run a default TCP server with a custom template and trust a custom header set by an upstream proxy](#run-a-default-tcp-server-with-a-custom-template-and-trust-a-custom-header-set-by-an-upstream-proxy)
|
||||
- [Download](#download)
|
||||
- [Docker](#docker)
|
||||
- [Running a container locally using test databases](#running-a-container-locally-using-test-databases)
|
||||
- [Run a container locally using test databases](#run-a-container-locally-using-test-databases)
|
||||
- [From Docker Hub](#from-docker-hub)
|
||||
|
||||
Just another "what is my IP address" service, including geolocation and headers information, written in go with high performance in mind, it uses [gin](https://github.com/gin-gonic/gin) which uses [httprouter](https://github.com/julienschmidt/httprouter) a lightweight high performance HTTP multiplexer.
|
||||
@ -103,13 +104,15 @@ Usage of ./whatismyip:
|
||||
### Run a TLS (HTTP/2) server only
|
||||
|
||||
```bash
|
||||
./whatismyip -geoip2-city ./test/GeoIP2-City-Test.mmdb -geoip2-asn ./test/GeoLite2-ASN-Test.mmdb -bind "" -tls-bind :8081 -tls-crt ./test/server.pem -tls-key ./test/server.key
|
||||
./whatismyip -geoip2-city ./test/GeoIP2-City-Test.mmdb -geoip2-asn ./test/GeoLite2-ASN-Test.mmdb \
|
||||
-bind "" -tls-bind :8081 -tls-crt ./test/server.pem -tls-key ./test/server.key
|
||||
```
|
||||
|
||||
### Run a default TCP server with a custom template and trust a custom header set by an upstream proxy
|
||||
|
||||
```bash
|
||||
./whatismyip -geoip2-city ./test/GeoIP2-City-Test.mmdb -geoip2-asn ./test/GeoLite2-ASN-Test.mmdb -trusted-header X-Real-IP -template mytemplate.tmpl
|
||||
./whatismyip -geoip2-city ./test/GeoIP2-City-Test.mmdb -geoip2-asn ./test/GeoLite2-ASN-Test.mmdb \
|
||||
-trusted-header X-Real-IP -template mytemplate.tmpl
|
||||
```
|
||||
|
||||
## Download
|
||||
@ -120,7 +123,7 @@ Download latest version from https://github.com/dcarrillo/whatismyip/releases
|
||||
|
||||
An ultra-light (~9MB) image is available.
|
||||
|
||||
### Running a container locally using test databases
|
||||
### Run a container locally using test databases
|
||||
|
||||
`make docker-run`
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package core
|
||||
|
||||
// Version to be defined on build time
|
||||
// Version to be defined at build time
|
||||
var Version = "tobedefined"
|
||||
|
@ -7,11 +7,6 @@ import (
|
||||
"github.com/oschwald/maxminddb-golang"
|
||||
)
|
||||
|
||||
// Record is the interface to be implemented for record operations
|
||||
type Record interface {
|
||||
LookUp(ip net.IP)
|
||||
}
|
||||
|
||||
// GeoRecord is the model for City database
|
||||
type GeoRecord struct {
|
||||
Country struct {
|
||||
|
Loading…
Reference in New Issue
Block a user