diff --git a/README.md b/README.md index cd9dbc5..713bd9c 100644 --- a/README.md +++ b/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` @@ -131,6 +134,6 @@ docker run --tty --interactive --rm \ -v $PWD/:/tmp/GeoIP2-City-Test.mmdb:ro \ -v $PWD/:/tmp/GeoLite2-ASN-Test.mmdb:ro -p 8080:8080 \ dcarrillo/whatismyip:latest \ - -geoip2-city /tmp/GeoIP2-City-Test.mmdb \ - -geoip2-asn /tmp/GeoLite2-ASN-Test.mmdb + -geoip2-city /tmp/GeoIP2-City-Test.mmdb \ + -geoip2-asn /tmp/GeoLite2-ASN-Test.mmdb ``` diff --git a/internal/core/version.go b/internal/core/version.go index 509e625..c90fa93 100644 --- a/internal/core/version.go +++ b/internal/core/version.go @@ -1,4 +1,4 @@ package core -// Version to be defined on build time +// Version to be defined at build time var Version = "tobedefined" diff --git a/models/geo.go b/models/geo.go index cd82ef7..4b5959f 100644 --- a/models/geo.go +++ b/models/geo.go @@ -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 {