tasks

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRotatingCert = errors.New("error rotating certificate")
View Source
var ErrRunningTask = errors.New("task failed")

Functions

This section is empty.

Types

type BatchProcessor

type BatchProcessor struct {
	// contains filtered or unexported fields
}

BatchProcessor handles the common batch processing logic for async tasks

func NewBatchProcessor

func NewBatchProcessor(repo repo.Repo) *BatchProcessor

NewBatchProcessor creates a new batch processor

func (*BatchProcessor) ProcessTenantsInBatch

func (bp *BatchProcessor) ProcessTenantsInBatch(
	ctx context.Context,
	taskName string,
	asynqTask *asynq.Task,
	processTenant func(ctx context.Context, tenant *model.Tenant, index int) error,
) error

ProcessTenantsInBatch iterates through tenants in batches and applies the process function It tracks the total tenant count, logs batch progress, and logs task completion

type CertRotator

type CertRotator struct {
	// contains filtered or unexported fields
}

func NewCertRotator

func NewCertRotator(
	certClient CertUpdater,
	repo repo.Repo,
) *CertRotator

func (*CertRotator) ProcessTask

func (s *CertRotator) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*CertRotator) TaskType

func (s *CertRotator) TaskType() string

type CertUpdater

type CertUpdater interface {
	GetCertificatesForRotation(ctx context.Context,
	) ([]*model.Certificate, int, error)
	RotateCertificate(ctx context.Context, args model.RequestCertArgs) (*model.Certificate,
		*rsa.PrivateKey, error)
}

type HYOKSync

type HYOKSync struct {
	// contains filtered or unexported fields
}

func NewHYOKSync

func NewHYOKSync(
	hyokClient HYOKUpdater,
	repo repo.Repo,
) *HYOKSync

func (*HYOKSync) ProcessTask

func (h *HYOKSync) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*HYOKSync) TaskType

func (h *HYOKSync) TaskType() string

type HYOKUpdater

type HYOKUpdater interface {
	SyncHYOKKeys(ctx context.Context) error
}

type KeystorePoolFiller

type KeystorePoolFiller struct {
	// contains filtered or unexported fields
}

func NewKeystorePoolFiller

func NewKeystorePoolFiller(
	updater KeystorePoolUpdater,
	repo repo.Repo,
	poolConfig config.KeystorePool,
) *KeystorePoolFiller

func (*KeystorePoolFiller) ProcessTask

func (k *KeystorePoolFiller) ProcessTask(ctx context.Context, _ *asynq.Task) error

func (*KeystorePoolFiller) TaskType

func (k *KeystorePoolFiller) TaskType() string

type KeystorePoolUpdater

type KeystorePoolUpdater interface {
	FillKeystorePool(ctx context.Context, size int) error
}

type NotificationClient

type NotificationClient interface {
	CreateNotification(ctx context.Context, notif client.Data) error
}

type NotificationSender

type NotificationSender struct {
	// contains filtered or unexported fields
}

func NewNotificationSender

func NewNotificationSender(
	client NotificationClient,
) *NotificationSender

func (*NotificationSender) ProcessTask

func (n *NotificationSender) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*NotificationSender) TaskType

func (n *NotificationSender) TaskType() string

type SystemUpdater

type SystemUpdater interface {
	UpdateSystems(ctx context.Context) error
}

type SystemsRefresher

type SystemsRefresher struct {
	// contains filtered or unexported fields
}

func NewSystemsRefresher

func NewSystemsRefresher(
	systemClient SystemUpdater,
	repo repo.Repo,
) *SystemsRefresher

func (*SystemsRefresher) ProcessTask

func (s *SystemsRefresher) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*SystemsRefresher) TaskType

func (s *SystemsRefresher) TaskType() string

type WorkflowCleaner

type WorkflowCleaner struct {
	// contains filtered or unexported fields
}

func NewWorkflowCleaner

func NewWorkflowCleaner(
	workflowRemoval WorkflowRemoval,
	repo repo.Repo,
) *WorkflowCleaner

func (*WorkflowCleaner) ProcessTask

func (wc *WorkflowCleaner) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*WorkflowCleaner) TaskType

func (wc *WorkflowCleaner) TaskType() string

type WorkflowExpiryProcessor

type WorkflowExpiryProcessor struct {
	// contains filtered or unexported fields
}

func NewWorkflowExpiryProcessor

func NewWorkflowExpiryProcessor(
	updater WorkflowExpiryUpdater,
	repo repo.Repo,
) *WorkflowExpiryProcessor

func (*WorkflowExpiryProcessor) ProcessTask

func (s *WorkflowExpiryProcessor) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*WorkflowExpiryProcessor) TaskType

func (s *WorkflowExpiryProcessor) TaskType() string

type WorkflowExpiryUpdater

type WorkflowExpiryUpdater interface {
	GetWorkflows(ctx context.Context, params repo.QueryMapper) ([]*model.Workflow, int, error)
	TransitionWorkflow(ctx context.Context, userID uuid.UUID,
		workflowID uuid.UUID, transition wfMechanism.Transition) (*model.Workflow, error)
}

type WorkflowProcessor

type WorkflowProcessor struct {
	// contains filtered or unexported fields
}

func NewWorkflowProcessor

func NewWorkflowProcessor(
	updater WorkflowUpdater,
	repo repo.Repo,
) *WorkflowProcessor

func (*WorkflowProcessor) ProcessTask

func (s *WorkflowProcessor) ProcessTask(ctx context.Context, task *asynq.Task) error

func (*WorkflowProcessor) TaskType

func (s *WorkflowProcessor) TaskType() string

type WorkflowRemoval

type WorkflowRemoval interface {
	CleanupTerminalWorkflows(ctx context.Context) error
}

type WorkflowUpdater

type WorkflowUpdater interface {
	AutoAssignApprovers(ctx context.Context, workflowID uuid.UUID) (*model.Workflow, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL