Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package recording
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/db"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/errors"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/globals"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/kms"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/scheduler"
|
|
)
|
|
|
|
// RegisterJob registers the delete session recording job with the provided scheduler.
|
|
func RegisterJob(ctx context.Context,
|
|
s *scheduler.Scheduler,
|
|
r db.Reader,
|
|
w db.Writer,
|
|
controllerExt globals.ControllerExtension,
|
|
kms kms.GetWrapperer,
|
|
) error {
|
|
const op = "storage.RegisterJob"
|
|
switch {
|
|
case s == nil:
|
|
return errors.New(ctx, errors.InvalidParameter, op, "missing scheduler")
|
|
case r == nil:
|
|
return errors.New(ctx, errors.InvalidParameter, op, "missing db.Reader")
|
|
case w == nil:
|
|
return errors.New(ctx, errors.InvalidParameter, op, "missing db.Writer")
|
|
case kms == nil:
|
|
return errors.New(ctx, errors.InvalidParameter, op, "missing kms")
|
|
}
|
|
|
|
dsrJob, err := NewDeleteSessionRecordingJobFn(ctx, r, w, controllerExt, kms)
|
|
if err != nil {
|
|
return fmt.Errorf("error creating delete session recording job: %w", err)
|
|
}
|
|
if err := s.RegisterJob(ctx, dsrJob); err != nil {
|
|
return errors.Wrap(ctx, err, op)
|
|
}
|
|
|
|
return nil
|
|
}
|