timpalpant / go-iex Goto Github PK
View Code? Open in Web Editor NEWA Go library for accessing the IEX Developer API.
License: GNU Lesser General Public License v3.0
A Go library for accessing the IEX Developer API.
License: GNU Lesser General Public License v3.0
I am trying to pipe a UDP stream into the pcap parser. It seems to take a io.Reader which the UDP go package supports.
conn, _ := net.ListenMulticastUDP("udp", iface, addr)
packetDataSource, err := iex.NewPacketDataSource( conn )
if err != nil {
panic(err)
}
pcapScanner := iex.NewPcapScanner(packetDataSource)
// decoding stuff here
However I get the following error:
panic: Unknown magic 80040001
Any insights would be greatly appreciated.
Thanks,
The HIST API provides data files containing IEXTP packet captures for the TOPS and DEEP endpoints each day. Implement parsers for these protocols. The specs are available here: https://www.iextrading.com/trading/market-data/#specifications
No matter what parameter is passed to the method GetHistoricalDaily, the result is always the same.
The problem is that the parameter is not passed onwards to getJSON, it should be passed like this:
err := c.getJSON("/stats/historical/daily", req, &result)
Hi there!
I really just wanted to checkout whats contained in the pcap files returned from the https://api.iextrading.com/1.0/hist
endpoint.
I was testing the pcap2json utility with the example file available here:
https://www.googleapis.com/download/storage/v1/b/iex/o/data%2Ffeeds%2F20170911%2F20170911_IEXTP1_TOPS1.5.pcap.gz?generation=1505174874390598&alt=media
Output as follows:
pcap2json < 20170911_IEXTP1_TOPS1.5.pcap
2017/09/12 15:01:03 Unknown magic a0d0d0a
Had comparable errors with other pcap parsers. Wireshark seems to parse it just fine but I've got no clue how to decode the raw payload <.<
I'm on ubuntu 16.04 LTS using go 1.9.
Getting error when trying the retrieve dividends
http: panic serving 127.0.0.1:54063: 403 Forbidden: Forbidden
package main
import (
"fmt"
"html/template"
"net/http"
"github.com/timpalpant/go-iex"
)
func process(w http.ResponseWriter, r *http.Request) {
client := iex.NewClient(&http.Client{})
var s []string
symbols := []string{"AAPL", "SPY"}
for _, symb := range symbols {
stat, err := client.GetKeyStats(symb)
if err != nil {
panic(err)
}
s = append(s, fmt.Sprintf("DividendYield: %s", stat.DividendYield))
}
t, _ := template.ParseFiles("Dividends.html")
t.Execute(w, s)
}
////
func main() {
server := http.Server{
Addr: "127.0.0.1:8080",
}
http.HandleFunc("/process", process)
server.ListenAndServe()
}
2020/01/27 03:34:59 http: panic serving 127.0.0.1:54063: 403 Forbidden: Forbidden
goroutine 19 [running]:
net/http.(*conn).serve.func1(0xc000162820)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002defb0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0001ba000, 0xc0001a8000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0001ba000, 0xc0001a8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0001ba000, 0xc0001a8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0001ba000, 0xc0001a8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000162820, 0x158dce0, 0xc00019e000)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:34:59 http: panic serving 127.0.0.1:54064: 403 Forbidden: Forbidden
goroutine 20 [running]:
net/http.(*conn).serve.func1(0xc0001628c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003cab90)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d420, 0xc0001a6000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d420, 0xc0001a6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d420, 0xc0001a6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d420, 0xc0001a6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0001628c0, 0x158dce0, 0xc0000a0340)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:34:59 http: panic serving 127.0.0.1:54066: 403 Forbidden: Forbidden
goroutine 47 [running]:
net/http.(*conn).serve.func1(0xc0002da820)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003e2070)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0002e4700, 0xc0001a6100)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0002e4700, 0xc0001a6100)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0002e4700, 0xc0001a6100)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0002e4700, 0xc0001a6100)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0002da820, 0x158dce0, 0xc0002141c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:00 http: panic serving 127.0.0.1:54067: 403 Forbidden: Forbidden
goroutine 23 [running]:
net/http.(*conn).serve.func1(0xc000326140)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003e20e0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0002e48c0, 0xc0001a6300)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0002e48c0, 0xc0001a6300)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0002e48c0, 0xc0001a6300)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0002e48c0, 0xc0001a6300)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326140, 0x158dce0, 0xc000214380)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:00 http: panic serving 127.0.0.1:54068: 403 Forbidden: Forbidden
goroutine 24 [running]:
net/http.(*conn).serve.func1(0xc0003261e0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002df1c0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d5e0, 0xc0001a8200)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d5e0, 0xc0001a8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d5e0, 0xc0001a8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d5e0, 0xc0001a8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0003261e0, 0x158dce0, 0xc000030040)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:00 http: panic serving 127.0.0.1:54069: 403 Forbidden: Forbidden
goroutine 25 [running]:
net/http.(*conn).serve.func1(0xc000326280)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003e2250)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc000338000, 0xc0001a8300)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc000338000, 0xc0001a8300)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc000338000, 0xc0001a8300)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc000338000, 0xc0001a8300)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326280, 0x158dce0, 0xc0000300c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:01 http: panic serving 127.0.0.1:54070: 403 Forbidden: Forbidden
goroutine 28 [running]:
net/http.(*conn).serve.func1(0xc000326460)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002df3a0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0002e4a80, 0xc0001a6500)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0002e4a80, 0xc0001a6500)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0002e4a80, 0xc0001a6500)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0002e4a80, 0xc0001a6500)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326460, 0x158dce0, 0xc000214580)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:01 http: panic serving 127.0.0.1:54071: 403 Forbidden: Forbidden
goroutine 29 [running]:
net/http.(*conn).serve.func1(0xc000326500)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003cb060)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0002e4d20, 0xc0001a8500)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0002e4d20, 0xc0001a8500)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0002e4d20, 0xc0001a8500)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0002e4d20, 0xc0001a8500)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326500, 0x158dce0, 0xc000030280)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:01 http: panic serving 127.0.0.1:54072: 403 Forbidden: Forbidden
goroutine 30 [running]:
net/http.(*conn).serve.func1(0xc000326d20)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003e23f0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0003381c0, 0xc0001a8600)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0003381c0, 0xc0001a8600)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0003381c0, 0xc0001a8600)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0003381c0, 0xc0001a8600)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326d20, 0x158dce0, 0xc000030300)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:06 http: panic serving 127.0.0.1:54083: 403 Forbidden: Forbidden
goroutine 10 [running]:
net/http.(*conn).serve.func1(0xc0002275e0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002df510)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d960, 0xc0001a8800)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d960, 0xc0001a8800)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d960, 0xc0001a8800)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d960, 0xc0001a8800)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0002275e0, 0x158dce0, 0xc0000304c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:06 http: panic serving 127.0.0.1:54084: 403 Forbidden: Forbidden
goroutine 11 [running]:
net/http.(*conn).serve.func1(0xc000227900)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002df760)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022dc00, 0xc0002c4300)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022dc00, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022dc00, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022dc00, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000227900, 0x158dce0, 0xc00043f700)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:06 http: panic serving 127.0.0.1:54085: 403 Forbidden: Forbidden
goroutine 16 [running]:
net/http.(*conn).serve.func1(0xc000227c20)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0003e2480)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022dea0, 0xc0002c4600)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022dea0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022dea0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022dea0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000227c20, 0x158dce0, 0xc00043fa00)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:25 http: panic serving 127.0.0.1:54092: 403 Forbidden: Forbidden
goroutine 33 [running]:
net/http.(*conn).serve.func1(0xc000327040)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0004dc1b0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0004da1c0, 0xc0005f8000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0004da1c0, 0xc0005f8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0004da1c0, 0xc0005f8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0004da1c0, 0xc0005f8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000327040, 0x158dce0, 0xc000030540)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:26 http: panic serving 127.0.0.1:54110: 403 Forbidden: Forbidden
goroutine 103 [running]:
net/http.(*conn).serve.func1(0xc0004e03c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002fa080)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022c1c0, 0xc0002c4000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022c1c0, 0xc0002c4000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022c1c0, 0xc0002c4000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022c1c0, 0xc0002c4000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0004e03c0, 0x158dce0, 0xc00043e040)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:26 http: panic serving 127.0.0.1:54115: 403 Forbidden: Forbidden
goroutine 106 [running]:
net/http.(*conn).serve.func1(0xc0004e0820)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0004dc370)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0004da380, 0xc0002c4300)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0004da380, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0004da380, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0004da380, 0xc0002c4300)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0004e0820, 0x158dce0, 0xc00043e1c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:26 http: panic serving 127.0.0.1:54117: 403 Forbidden: Forbidden
goroutine 109 [running]:
net/http.(*conn).serve.func1(0xc0004e0dc0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002c0050)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022c700, 0xc0005f8200)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022c700, 0xc0005f8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022c700, 0xc0005f8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022c700, 0xc0005f8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0004e0dc0, 0x158dce0, 0xc000030180)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:26 http: panic serving 127.0.0.1:54118: 403 Forbidden: Forbidden
goroutine 110 [running]:
net/http.(*conn).serve.func1(0xc0004e0fa0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc00046c4d0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022ca80, 0xc0002c4500)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022ca80, 0xc0002c4500)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022ca80, 0xc0002c4500)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022ca80, 0xc0002c4500)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0004e0fa0, 0x158dce0, 0xc00043e380)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:26 http: panic serving 127.0.0.1:54119: 403 Forbidden: Forbidden
goroutine 114 [running]:
net/http.(*conn).serve.func1(0xc00037a000)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002c0230)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0003ae1c0, 0xc0001b8000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0003ae1c0, 0xc0001b8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0003ae1c0, 0xc0001b8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0003ae1c0, 0xc0001b8000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00037a000, 0x158dce0, 0xc000214080)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:31 http: panic serving 127.0.0.1:54125: 403 Forbidden: Forbidden
goroutine 117 [running]:
net/http.(*conn).serve.func1(0xc00037a3c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002c0530)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0003ae8c0, 0xc0002c4600)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0003ae8c0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0003ae8c0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0003ae8c0, 0xc0002c4600)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00037a3c0, 0x158dce0, 0xc00043e400)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:31 http: panic serving 127.0.0.1:54126: 403 Forbidden: Forbidden
goroutine 118 [running]:
net/http.(*conn).serve.func1(0xc00037a820)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0004dc4c0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d420, 0xc0001b8200)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d420, 0xc0001b8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d420, 0xc0001b8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d420, 0xc0001b8200)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00037a820, 0x158dce0, 0xc000214240)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 03:35:31 http: panic serving 127.0.0.1:54127: 403 Forbidden: Forbidden
goroutine 121 [running]:
net/http.(*conn).serve.func1(0xc00037aa00)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0002c06c0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0003aee00, 0xc0001b8400)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0003aee00, 0xc0001b8400)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0003aee00, 0xc0001b8400)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0003aee00, 0xc0001b8400)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00037aa00, 0x158dce0, 0xc000214440)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 07:44:10 http: panic serving 127.0.0.1:58136: 403 Forbidden: Forbidden
goroutine 124 [running]:
net/http.(*conn).serve.func1(0xc0004e03c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0004dc170)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0004da1c0, 0xc0000f6000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0004da1c0, 0xc0000f6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0004da1c0, 0xc0000f6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0004da1c0, 0xc0000f6000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0004e03c0, 0x158dce0, 0xc00043e000)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 07:44:41 http: panic serving 127.0.0.1:58177: 403 Forbidden: Forbidden
goroutine 166 [running]:
net/http.(*conn).serve.func1(0xc000227ae0)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc0004dc230)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d5e0, 0xc000196100)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d5e0, 0xc000196100)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d5e0, 0xc000196100)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d5e0, 0xc000196100)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000227ae0, 0x158dce0, 0xc000030180)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 07:44:41 http: panic serving 127.0.0.1:58178: 403 Forbidden: Forbidden
goroutine 167 [running]:
net/http.(*conn).serve.func1(0xc000227b80)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc00046d9c0)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc0004da380, 0xc000254000)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc0004da380, 0xc000254000)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc0004da380, 0xc000254000)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc0004da380, 0xc000254000)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000227b80, 0x158dce0, 0xc0002142c0)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
2020/01/27 07:44:41 http: panic serving 127.0.0.1:58183: 403 Forbidden: Forbidden
goroutine 169 [running]:
net/http.(*conn).serve.func1(0xc000326140)
/usr/local/opt/go/libexec/src/net/http/server.go:1767 +0x139
panic(0x1442140, 0xc00046db30)
/usr/local/opt/go/libexec/src/runtime/panic.go:679 +0x1b2
main.process(0x158d1e0, 0xc00022d960, 0xc000254200)
/Users/ed/Documents/Coding/Golang/src/web/web.go:18 +0x373
net/http.HandlerFunc.ServeHTTP(0x150b0d0, 0x158d1e0, 0xc00022d960, 0xc000254200)
/usr/local/opt/go/libexec/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x18d3180, 0x158d1e0, 0xc00022d960, 0xc000254200)
/usr/local/opt/go/libexec/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0001640e0, 0x158d1e0, 0xc00022d960, 0xc000254200)
/usr/local/opt/go/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc000326140, 0x158dce0, 0xc000214400)
/usr/local/opt/go/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/usr/local/opt/go/libexec/src/net/http/server.go:2928 +0x384
When fetching the /ref-data/symbols url from the web I get the response:
[{"symbol":"A","name":"Agilent Technologies Inc.","date":"2018-07-25","isEnabled":true,"type":"cs","iexId":"2"}, .....
However the Symbol structure in the project is defined as follows:
type Symbol struct {
// Refers to the symbol represented in Nasdaq Integrated symbology (INET).
**_Ticker string_**
// Refers to the name of the company or security.
Name string
// Refers to the date the symbol reference data was generated.
Date string
// Will be true if the symbol is enabled for trading on IEX.
IsEnabled bool
}
The Ticker
field should be renamed to Symbol
, otherwise it isn't decoded with the JSON and effectively, gets left out of the response of the method GetSymbols()
. This is an important field as it is the identifier of every stock.
Many of the API calls have streaming WebSocket analogs. Test whether they are usable with a Go WebSocket client and if so add APIs for using them.
Hi,
I'm currently using msg, err := pcapScanner.NextMessage()
and I'm trying to access the values contained in the msg struct. When I try to access using msg.MessageType
, I'm get an error:
./hello.go:69:51: msg.MessageType undefined (type iextp.Message has no field or method MessageType)
I know it has something to do with the inheritance between Message and other Message structs; what's the proper way of using this?
The library prints out the values the values in the terminal, but there does not seem to be a way to save the output as a txt/json file. Is there a way to do this?
Thanks for the great library!
When running main.go against the IEX pcap sample, some entries are not decoded to JSON correctly. The failed entries look like --> "WE2Bi5o3AroNFVpYSUVUICAgeEEPAAAAAAA="
Repro (on Windows)
go run C:\Users\user\Downloads\Projects\go-iex\pcap2json\main.go < 20180127_IEXTP1_TOPS1.6.pcap > iex.json
Also, it appears the output is truncated. For example, the last line in the output file is incomplete:
{"MessageType":81,"Flags":64,"Timestamp":"2018-01-27T17:35:26.6146978Z","Symbol":"AYT","BidSize":0,"BidPrice":0,
Hi,
Thank you for putting this library together. Quick question - I tried the "Iterate over data from a live multicast UDP stream of the DEEP feed" example and I am not seeing any PriceLevelUpdate messages. Before I start digging in, I was curious whether you know something about using the DEEP UDP Multicast that I don't? Do you have to have a subscription with IEX to use it? Thank you for your time and help.
Also, I'm looking into the Socket.IO issue.
Thanks for writing this library, it's very helpful for me.
I'm new to Go, and currently trying to run the sample code in the readme. I've created a new directory in go/src
, and when I try to run the file using go run testfile.go
, I get the following error:
# command-line-arguments
./hello.go:33:19: cannot assign 1 values to 2 variables
./hello.go:33:45: cannot use resp.Body (type io.ReadCloser) as type iex.PacketDataSource in argument to iex.NewPcapScanner:
io.ReadCloser does not implement iex.PacketDataSource (missing LinkType method)
As a Go newbie, I'd appreciate any help with understanding this error. Thanks!
go install github.com/timpalpant/go-iex/pcap2json
does not add a pcap2json
path to the root directory making it unusable for an otherwise useful pcap2json tool.
i am creating this issue to hopefully either fix the issue on the package level or iex api level.
here are two different api requests to iex:
https://iextrading.com/developer/docs/#historical-daily
and
https://iextrading.com/developer/docs/#recent
historical-daily
[
{
"date": "2017-05-09",
"volume": 152907569,
"routedVolume": 46943802,
"marketShare": 0.02246,
"isHalfday": 0,
"litVolume": 35426666
},
...
recent-stats
[
{
"date": "2017-01-11",
"volume": 128048723,
"routedVolume": 38314207,
"marketShare": 0.01769,
"isHalfday": false,
"litVolume": 30520534
},
...
in the first link the isHalfday
value is a int (0/1) and in the recent it is a bool value.
this seems like the best fix is at the api level but it is yet to be seen if they will fix it, i will create an issue with iex and link to the issue in the comments.
$ go get -u github.com/timpalpant/go-iex/pcap2json
go install github.com/timpalpant/go-iex/pcap2json
pcap# github.com/mdlayher/raw
../../go/src/github.com/mdlayher/raw/raw_linux.go:316:32: undefined: syscall.SYS_GETSOCKOPT
../../go/src/github.com/mdlayher/raw/raw_linux.go:329:32: undefined: syscall.SYS_SETSOCKOPT
../../go/src/github.com/mdlayher/raw/timeval.go:17:6: cannot use int64(timeout / time.Second) (type int64) as type int32 in field value
../../go/src/github.com/mdlayher/raw/timeval.go:18:7: cannot use int64(timeout % time.Second / time.Microsecond) (type int64) as type int32 in field value
$ go install github.com/timpalpant/go-iex/pcap2json
../../go/src/github.com/mdlayher/raw/raw_linux.go:316:32: undefined: syscall.SYS_GETSOCKOPT
../../go/src/github.com/mdlayher/raw/raw_linux.go:329:32: undefined: syscall.SYS_SETSOCKOPT
../../go/src/github.com/mdlayher/raw/timeval.go:17:6: cannot use int64(timeout / time.Second) (type int64) as type int32 in field value
../../go/src/github.com/mdlayher/raw/timeval.go:18:7: cannot use int64(timeout % time.Second / time.Microsecond) (type int64) as type int32 in field value
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.