cic-dw/internal/syncer/syncer.go
Mohamed Sohail 6b71657e5b
sohail/update deps structure (#5)
* refactor: syncer structure

- move syncer jobs to internal dir

* refactor: queries struct and pkg updates

- update cic-go to latest
- separate sql queries by logic

* ci: add dependabot
2022-05-11 12:32:11 +03:00

25 lines
559 B
Go

package syncer
import (
cic_net "github.com/grassrootseconomics/cic-go/net"
"github.com/hibiken/asynq"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/nleof/goyesql"
)
type Syncer struct {
db *pgxpool.Pool
rClient asynq.RedisConnOpt
cicnetClient *cic_net.CicNet
queries goyesql.Queries
}
func New(db *pgxpool.Pool, rClient asynq.RedisConnOpt, cicnetClient *cic_net.CicNet, queries goyesql.Queries) *Syncer {
return &Syncer{
db: db,
rClient: rClient,
cicnetClient: cicnetClient,
queries: queries,
}
}