🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/markkopaas/go-csv-json

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/markkopaas/go-csv-json

v0.0.0-20200308204558-4a4c609d35ec
Version published
Created

Start redis:

docker run -d -p 6379:6379 --name redis1 redis

Process csv file with template, and send output to redis

go run main.go -template "$(< redis.template)" <example.csv  | nc localhost 6379

Test read:

echo "GET 41.5" | nc localhost 6379

# {"City":"You\"ng'sto\nwn","EW":"W","LatD":"41","LatM":"5","LatS":"59","LonD":"80","LonM":"39","LonS":"0","NS":"N","State":"OH"}

Big test:

$ source generatecsv.sh 30000 >30k.csv
$ source generatecsv.sh 3000000 >3m.csv
$ tail 3m.csv
$ time (go run main.go -template "$(< redis.template)" <3m.csv  | nc localhost 6379 > /dev/null)

real	2m29.797s
user	1m28.762s
sys	1m8.159s

Inspect the store:

$ echo "DBSIZE" | nc localhost 6379
$ echo "GET 3000000.52" | nc localhost 6379

FAQs

Package last updated on 08 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts