mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-12-23 03:17:32 +01:00
Mohamed Sohail
6b71657e5b
* 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
25 lines
559 B
Go
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,
|
|
}
|
|
}
|