package main
import (
"github.com/kcotugno/tacitus/gdax"
"github.com/kcotugno/tacitus/gdax/websocket"
"github.com/kcotugno/tacitus/ops"
"github.com/kcotugno/tacitus/osutil"
"github.com/kcotugno/tacitus/postgres"
)
func main() {
logger := osutil.NewLogger()
db := postgres.NewClient()
db.Name = "gdax"
db.User = "gdax"
db.SetLogger(logger)
err := db.Open()
if err != nil {
logger.Info("Error openning database connection: %v", err)
return
}
ws := websocket.NewClient()
ls := &gdax.ListenerService{}
ls.Client = ws
ls.Logger = logger
r := ops.Registrar{}
r.Database = db
r.Listener = ls
r.SetLogger(logger)
if err := r.Record("ETH-USD", "BTC-USD"); err != nil {
logger.Info("Error: %v", err)
v := validator{}
v.db = db
v.logger = logger
v.validate("ETH-USD", "BTC-USD")
v.stop()
t := make(chan bool)
<-t