watcher: update for refactor
This commit is contained in:
parent
7f7ce5013d
commit
69edac109b
@ -1,17 +1,38 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kcotugno/tacitus/gdax"
|
||||||
|
"github.com/kcotugno/tacitus/gdax/websocket"
|
||||||
"github.com/kcotugno/tacitus/ops"
|
"github.com/kcotugno/tacitus/ops"
|
||||||
"github.com/kcotugno/tacitus/osutil"
|
"github.com/kcotugno/tacitus/osutil"
|
||||||
|
"github.com/kcotugno/tacitus/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
logger := osutil.NewLogger()
|
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)
|
r.SetLogger(logger)
|
||||||
if err := r.Record("ETH-USD", "BTC-USD"); err != nil {
|
if err := r.Record("ETH-USD", "BTC-USD"); err != nil {
|
||||||
logger.Info("Error: %v", err)
|
logger.Info("Error: %v", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
t := make(chan bool)
|
t := make(chan bool)
|
||||||
|
Reference in New Issue
Block a user