A CSV Writer API for goventory
$ go version
go version go1.10 darwin/amd64
$ sqlite3 version
SQLite version 3.16.0 2016-11-04 19:09:39
$ curl --version
curl 7.51.0 (x86_64-apple-darwin16.0) libcurl/7.51.0 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets
- Clone this repository
$ git clone https://github.com/haruelrovix/gocsv.git && cd gocsv
- Execute
gocsv.sh
$ ./gocsv.sh
- If it asks to accept incoming network connections, allow it.
gocsv
listening on port 4000
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /nilaibarang --> gocsv/api.ExportItemReport (3 handlers)
[GIN-debug] GET /penjualan --> gocsv/api.ExportSalesReport (3 handlers)
[GIN-debug] Environment variable PORT="4000"
[GIN-debug] Listening and serving HTTP on :4000
Have you heard about REST Client for VS Code ?
- Laporan Nilai Barang:
http://0.0.0.0:4000/nilaibarang
- Laporan Penjualan:
http://0.0.0.0:4000/penjualan?startdate=2017-12-01&enddate=2017-12-31
For the default, Harga
is in integer format. If you want to put Rp
in front of it, add rupiah=true
on the request.
http://0.0.0.0:4000/penjualan?startdate=2017-12-01&enddate=2017-12-31&rupiah=true
Another optional parameter is prettifydate
. In Toko Ijah alternate universe, there is no timezone. So it just removes T
and Z
from the timestamp
.
http://0.0.0.0:8080/penjualan?startdate=2017-12-01&enddate=2017-12-01&prettifydate=true
VS Code and Delve, a debugger for the Go programming language.