Merged in feature/jobsync (pull request #63)
Document Sync and Job Sync * docsyncfunc * startedQueryWork * morefixes * jobsyncsvcstart * save * jobsynctext * save * save * docsync * shorttest * jobsync * jobsyncupdateoncollectorupdate * passlivetest * collectortest * lint
This commit is contained in:
@@ -5,10 +5,9 @@ import (
|
||||
"log/slog"
|
||||
"os"
|
||||
doccleanrunner "queryorchestration/api/docCleanRunner"
|
||||
"queryorchestration/internal/document"
|
||||
documentclean "queryorchestration/internal/document/clean"
|
||||
cleanversion "queryorchestration/internal/document/clean/version"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttext"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
@@ -16,7 +15,6 @@ import (
|
||||
|
||||
type DocCleanConfig struct {
|
||||
runner.BaseConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
documenttext.DocTextConfig
|
||||
}
|
||||
|
||||
@@ -26,9 +24,8 @@ func main() {
|
||||
cfg := &DocCleanConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
doc := document.New(cfg)
|
||||
clean := documentclean.New(cfg, &documentclean.Services{
|
||||
Document: doc,
|
||||
Version: cleanversion.New(cfg),
|
||||
})
|
||||
|
||||
return doccleanrunner.New(cfg.GetValidator(), &doccleanrunner.Services{
|
||||
|
||||
@@ -5,20 +5,16 @@ import (
|
||||
"log/slog"
|
||||
"os"
|
||||
docinitrunner "queryorchestration/api/docInitRunner"
|
||||
"queryorchestration/internal/client"
|
||||
"queryorchestration/internal/document"
|
||||
documentinit "queryorchestration/internal/document/init"
|
||||
"queryorchestration/internal/job"
|
||||
"queryorchestration/internal/job/collector"
|
||||
"queryorchestration/internal/server/runner"
|
||||
documentcleanc "queryorchestration/internal/serviceconfig/queue/documentclean"
|
||||
documentsyncc "queryorchestration/internal/serviceconfig/queue/documentsync"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
type DocInitConfig struct {
|
||||
runner.BaseConfig
|
||||
documentcleanc.DocCleanConfig
|
||||
documentsyncc.DocSyncConfig
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -27,18 +23,7 @@ func main() {
|
||||
cfg := &DocInitConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
cli := client.New(cfg)
|
||||
doc := document.New(cfg)
|
||||
col := collector.New(cfg, &collector.Services{
|
||||
Document: doc,
|
||||
})
|
||||
j := job.New(cfg, &job.Services{
|
||||
Collector: col,
|
||||
Client: cli,
|
||||
})
|
||||
docinit := documentinit.New(cfg, &documentinit.Services{
|
||||
Job: j,
|
||||
})
|
||||
docinit := documentinit.New(cfg)
|
||||
|
||||
return docinitrunner.New(cfg.GetValidator(), &docinitrunner.Services{
|
||||
Document: docinit,
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"os"
|
||||
docsyncrunner "queryorchestration/api/docSyncRunner"
|
||||
"queryorchestration/internal/client"
|
||||
"queryorchestration/internal/document"
|
||||
cleanversion "queryorchestration/internal/document/clean/version"
|
||||
documentsync "queryorchestration/internal/document/sync"
|
||||
textversion "queryorchestration/internal/document/text/version"
|
||||
"queryorchestration/internal/job"
|
||||
"queryorchestration/internal/job/collector"
|
||||
"queryorchestration/internal/server/runner"
|
||||
documentcleanc "queryorchestration/internal/serviceconfig/queue/documentclean"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
type DocSyncConfig struct {
|
||||
runner.BaseConfig
|
||||
documentcleanc.DocCleanConfig
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &DocSyncConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
tev := textversion.New(cfg)
|
||||
clv := cleanversion.New(cfg)
|
||||
col := collector.New(cfg, &collector.Services{
|
||||
CleanVersion: clv,
|
||||
TextVersion: tev,
|
||||
})
|
||||
cli := client.New(cfg)
|
||||
jbb := job.New(cfg, &job.Services{
|
||||
Client: cli,
|
||||
Collector: col,
|
||||
})
|
||||
doc := document.New(cfg)
|
||||
docsync := documentsync.New(cfg, &documentsync.Services{
|
||||
Document: doc,
|
||||
Job: jbb,
|
||||
})
|
||||
|
||||
return docsyncrunner.New(cfg.GetValidator(), &docsyncrunner.Services{
|
||||
Document: docsync,
|
||||
})
|
||||
}
|
||||
|
||||
server, err := runner.New(ctx, cfg)
|
||||
if err != nil {
|
||||
slog.Error(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
server.Listen(ctx)
|
||||
}
|
||||
@@ -5,10 +5,9 @@ import (
|
||||
"log/slog"
|
||||
"os"
|
||||
doctextrunner "queryorchestration/api/docTextRunner"
|
||||
"queryorchestration/internal/document"
|
||||
documenttext "queryorchestration/internal/document/text"
|
||||
textversion "queryorchestration/internal/document/text/version"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/querysync"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
@@ -16,7 +15,6 @@ import (
|
||||
|
||||
type DocTextConfig struct {
|
||||
runner.BaseConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
querysync.QuerySyncConfig
|
||||
}
|
||||
|
||||
@@ -26,9 +24,8 @@ func main() {
|
||||
cfg := &DocTextConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
doc := document.New(cfg)
|
||||
text := documenttext.New(cfg, &documenttext.Services{
|
||||
Document: doc,
|
||||
Version: textversion.New(cfg),
|
||||
})
|
||||
|
||||
return doctextrunner.New(cfg.GetValidator(), &doctextrunner.Services{
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"os"
|
||||
jobsyncrunner "queryorchestration/api/jobSyncRunner"
|
||||
jobsync "queryorchestration/internal/job/sync"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/queue/documentsync"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
type JobSyncConfig struct {
|
||||
runner.BaseConfig
|
||||
documentsync.DocSyncConfig
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &JobSyncConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
svc := jobsync.New(cfg)
|
||||
|
||||
c := jobsyncrunner.New(cfg.GetValidator(), &jobsyncrunner.Services{
|
||||
JobSync: svc,
|
||||
})
|
||||
|
||||
return &c
|
||||
}
|
||||
|
||||
server, err := runner.New(ctx, cfg)
|
||||
if err != nil {
|
||||
slog.Error(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
server.Listen(ctx)
|
||||
}
|
||||
+32
-14
@@ -8,22 +8,31 @@ import (
|
||||
queryservice "queryorchestration/api/queryService"
|
||||
"queryorchestration/internal/client"
|
||||
"queryorchestration/internal/document"
|
||||
cleanversion "queryorchestration/internal/document/clean/version"
|
||||
textversion "queryorchestration/internal/document/text/version"
|
||||
"queryorchestration/internal/export"
|
||||
"queryorchestration/internal/job"
|
||||
"queryorchestration/internal/job/collector"
|
||||
collectorupdate "queryorchestration/internal/job/collector/update"
|
||||
"queryorchestration/internal/query"
|
||||
"queryorchestration/internal/query/result"
|
||||
querytest "queryorchestration/internal/query/test"
|
||||
service "queryorchestration/internal/server/service"
|
||||
"queryorchestration/internal/serviceconfig/queue/jobsync"
|
||||
|
||||
"github.com/getkin/kin-openapi/openapi3"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
type QueryServiceConfig struct {
|
||||
service.BaseConfig
|
||||
jobsync.JobSyncConfig
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &service.BaseConfig{}
|
||||
cfg := &QueryServiceConfig{}
|
||||
|
||||
cfg.RegisterHandlersFunc = func() (*openapi3.T, error) {
|
||||
exp := export.New()
|
||||
@@ -31,28 +40,37 @@ func main() {
|
||||
res := result.New(cfg, &result.Services{
|
||||
Query: que,
|
||||
})
|
||||
doc := document.New(cfg)
|
||||
tev := textversion.New(cfg)
|
||||
clv := cleanversion.New(cfg)
|
||||
col := collector.New(cfg, &collector.Services{
|
||||
Document: doc,
|
||||
CleanVersion: clv,
|
||||
TextVersion: tev,
|
||||
})
|
||||
colupdate := collectorupdate.New(cfg, &collectorupdate.Services{
|
||||
Collector: col,
|
||||
CleanVersion: clv,
|
||||
TextVersion: tev,
|
||||
})
|
||||
cli := client.New(cfg)
|
||||
jbb := job.New(cfg, &job.Services{
|
||||
Client: cli,
|
||||
Collector: col,
|
||||
})
|
||||
doc := document.New(cfg)
|
||||
quetest := querytest.New(cfg, &querytest.Services{
|
||||
Collector: col,
|
||||
Result: res,
|
||||
Document: doc,
|
||||
})
|
||||
cli := client.New(cfg)
|
||||
jbb := job.New(cfg, &job.Services{
|
||||
Collector: col,
|
||||
Client: cli,
|
||||
})
|
||||
|
||||
services := &queryservice.Services{
|
||||
Export: exp,
|
||||
Collector: col,
|
||||
Query: que,
|
||||
Client: cli,
|
||||
Job: jbb,
|
||||
QueryTest: quetest,
|
||||
Export: exp,
|
||||
Collector: col,
|
||||
CollectorUpdate: colupdate,
|
||||
Query: que,
|
||||
Client: cli,
|
||||
Job: jbb,
|
||||
QueryTest: quetest,
|
||||
}
|
||||
|
||||
cons := queryservice.NewControllers(cfg.GetValidator(), services)
|
||||
|
||||
Reference in New Issue
Block a user