json-csv-converter-golang

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 15 Imported by: 0

README

Convert JSON to CSV using golang

GitHub stars Go Report Card

Build and run

sudo chmod -R 777 public/download &&\ CGO_ENABLED=0 GOOS=linux go build -tags netgo -ldflags "-s" -a -installsuffix cgo -o service &&\ docker build -t service . &&\ docker run -e -it -p 8081:8081 -v /home/{user}/{app folder}/public/download:/public/download service

Test

curl -X POST -H 'Content-Type:application/json' --data '[{"number":1,"columns":["Line1", "Test1", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit,"]},{"number":2,"columns":["Line2", "Test2", "sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."]}]' http://localhost:8081 -vvv

Performance comparison

Application Language Size of JSON - 10 Kb Size of JSON - 100 Kb Size of JSON - 500 Kb
https://github.com/ship87/json-csv-converter-php PHP 7.4 1020 ms 8178 ms 44523 ms
https://github.com/ship87/json-csv-converter-golang Go 1.13 720 ms 5218 ms 23762 ms

*Kb - kilobytes
*ms - microseconds, average value

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL