watcher: update for refactor
This commit is contained in:
parent
7f7ce5013d
commit
69edac109b
@ -1,17 +1,38 @@
|
||||
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()
|
||||
|
||||
r := ops.NewRegistrar()
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
||||
t := make(chan bool)
|
||||
|
Reference in New Issue
Block a user