Skip to content

A golang package for mapping IP to the nearest Taipei MRT station.

Notifications You must be signed in to change notification settings

cclin81922/ipttmrts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

go get -u github.com/cclin81922/ipttmrts/cmd/ipttmrts
export PATH=$PATH:~/go/bin

Command Line Usage

Usage 1

GoogleGeolocationAPIKey=... ipttmrts

// output the nearest MRT station

Usage 2

ipttmrts -ip=101.15.22.238

// output the nearest MRT station

To output debug message as well, use flag -logtostderr=true -v=2

Package Usage

import "github.com/cclin81922/ipttmrts/pkg/ipttmrts"

func demo(data ipttmrts.IData) {
    ipttmrts.Map(data)
}

For Developer

Run all tests

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts

Run selected tests e.g.,

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -run=TestFindNearTaipeiMRTStation/誠正國中

Run all benchmarks

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -bench=. -benchmem

Run selected benchmarks e.g.,

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -bench=BenchmarkFindNearTaipeiMRTStation/誠正國中 -benchmem

View API doc by terminal

go doc github.com/cclin81922/ipttmrts/pkg/ipttmrts

View API doc by web browser (offline)

godoc -http=:6060
open http://localhost:6060/pkg/github.com/cclin81922/ipttmrts/pkg/ipttmrts

View API doc by web browser (online)

open https://godoc.org/github.com/cclin81922/ipttmrts/pkg/ipttmrts

Related Resources

About

A golang package for mapping IP to the nearest Taipei MRT station.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages