putting in base query and collector framework
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package document
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gotemplate/internal/database/repository"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
db *repository.Queries
|
||||
}
|
||||
|
||||
type Document struct {
|
||||
ID string `json:"id"`
|
||||
JobID string `json:"jobId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func New(ctx context.Context, db *repository.Queries) *Service {
|
||||
return &Service{
|
||||
db: db,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Service) Sync(ctx context.Context, doc Document) error {
|
||||
// Check if collector exists for doc and is synced
|
||||
// Check if job set up
|
||||
// If not find all outputs and see if any are out of sync/missing
|
||||
// create dependency tree - if sync triggered, sync all dependent outputs by using queue
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user