Permalink
Browse files

Using go deploy on heroku

  • Loading branch information...
s32x committed Dec 1, 2018
1 parent a921c40 commit 35e0e2a3ab199c67f915deb53af61f9b2a869c9c
Showing with 38 additions and 22 deletions.
  1. +29 −0 LICENSE
  2. +1 −14 Makefile
  3. +5 −5 README.md
  4. +2 −2 ipdata/client.go
  5. +1 −1 main.go
29 LICENSE
@@ -0,0 +1,29 @@
The BSD 3-clause License
========================

Copyright (c) 2018, Steven Wolfe. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

- Neither the name of ipdata nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,5 +1,3 @@
project = ipdata

deps:
-rm Gopkg.toml
-rm Gopkg.lock
@@ -9,15 +7,4 @@ test:
go clean
go test ./...
run:
go run main.go
build:
make deps
go build -o bin/server
deploy:
make deps
make test
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/server
heroku container:login
heroku container:push web -a $(project)
heroku container:release web -a $(project)
rm ipdata
go run main.go
@@ -1,6 +1,6 @@
# IPData
# ipdata

[![CircleCI](https://circleci.com/gh/s32x/ipdata.svg?style=svg)](https://circleci.com/gh/s32x/ipdata)
[![Circle CI](https://circleci.com/gh/s32x/ipdata/tree/master.svg?style=svg)](https://circleci.com/gh/s32x/ipdata/tree/master)
[![GoDoc](https://godoc.org/github.com/s32x/ipdata/ipdata?status.svg)](https://godoc.org/github.com/s32x/ipdata/ipdata)

ipdata is a free and open-source ip address lookup system. It combines the results retrieved from multiple maxminddb databases to provide you general geo/isp data for version 4 addresses. The project is available in three forms, the Golang library `ipdata` which can easily be used in your own Go projects, a public API endpoint (more info: https://ipdata.info), and a public Docker image on DockerHub (see: https://hub.docker.com/r/s32x/ipdata/).
@@ -20,12 +20,12 @@ package main
import (
"log"
"s32x.com/ipdata"
"s32x.com/ipdata/ipdata"
)
func main() {
// Create the ipdata client
ic, err := ipdata.New()
ic, err := ipdata.NewClient()
if err != nil {
log.Fatal(err)
}
@@ -46,7 +46,7 @@ ipdata
## Running with Docker

```
docker run -p 8080:8080 sdwolfe32/ipdata
docker run -p 8080:8080 s32x/ipdata
```

The BSD 3-clause License
@@ -20,8 +20,8 @@ type Client struct {
city, asn maxminddb.Reader
}

// New creates and returns a fully populated ipdata Client
func New() (*Client, error) {
// NewClient creates and returns a fully populated ipdata Client
func NewClient() (*Client, error) {
c := &Client{mu: sync.Mutex{}}
if err := c.updateReaders(); err != nil {
return nil, err
@@ -27,7 +27,7 @@ func main() {
e.Use(middleware.CORS())

// Create the ipdata client
ic, err := ipdata.New()
ic, err := ipdata.NewClient()
if err != nil {
log.Fatal(err)
}

0 comments on commit 35e0e2a

Please sign in to comment.