Documentation
¶
Overview ¶
Package jobspec contains job specifications for various background jobs used throughout the application.
Index ¶
- Constants
- type AttestNDARequestArgs
- type CampaignDispatchAction
- type CampaignDispatchArgs
- type CreateCustomDomainArgs
- type CreateDomainScanArgs
- type CreatePirschDomainArgs
- type CreatePreviewDomainArgs
- type CreatePreviewDomainSSLAcmeArgs
- type CreateTaskArgs
- type DeleteCustomDomainArgs
- type DeletePirschDomainArgs
- type DeletePreviewDomainArgs
- type ExportContentArgs
- type OrganizationDeletionArgs
- type OrganizationDeletionReminderArgs
- type RetrieveDomainScanArgs
- type UpdatePirschDomainArgs
- type ValidateCustomDomainArgs
- type ValidatePreviewDomainArgs
- type WatermarkDocArgs
Constants ¶
const ( // QueueDefault holds jobs that have not been put in any specific queue QueueDefault = "default" // QueueCompliance is the queue for compliance jobs. QueueCompliance = "compliance" // QueueTrustcenter is the queue for trust center jobs. QueueTrustcenter = "trustcenter" // QueueNotification is the queue for notification jobs. QueueNotification = "notifications" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestNDARequestArgs ¶ added in v1.0.6
type AttestNDARequestArgs struct {
// NDARequestID is the id of the request
NDARequestID string `json:"nda_request_id"`
// TrustCenterNDAFullURL is the url to access the private document
TrustCenterNDAFullURL string `json:"trust_center_nda_full_url"`
}
AttestNDARequestArgs for the worker to process the signed nda pdf
func (AttestNDARequestArgs) InsertOpts ¶ added in v1.0.6
func (AttestNDARequestArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (AttestNDARequestArgs) Kind ¶ added in v1.0.6
func (AttestNDARequestArgs) Kind() string
Kind satisfies the river.Job interface
type CampaignDispatchAction ¶ added in v1.0.7
type CampaignDispatchAction string
CampaignDispatchAction identifies which campaign dispatch workflow should run.
const ( // CampaignDispatchActionLaunch dispatches the initial campaign launch. CampaignDispatchActionLaunch CampaignDispatchAction = "launch" // CampaignDispatchActionResend dispatches a resend to previously-sent targets. CampaignDispatchActionResend CampaignDispatchAction = "resend" // CampaignDispatchActionResendIncomplete dispatches a resend to incomplete targets. CampaignDispatchActionResendIncomplete CampaignDispatchAction = "resend_incomplete" )
CampaignDispatchActions defines the supported dispatch actions for campaigns.
type CampaignDispatchArgs ¶ added in v1.0.7
type CampaignDispatchArgs struct {
// CampaignID is the campaign to dispatch (required).
CampaignID string `json:"campaign_id" river:"unique"`
// Action identifies the dispatch behavior (required).
Action CampaignDispatchAction `json:"action" river:"unique"`
// ScheduledAt is the requested schedule time (optional).
ScheduledAt *time.Time `json:"scheduled_at,omitempty" river:"unique"`
// RequestedBy is the user that requested the dispatch (optional).
RequestedBy string `json:"requested_by,omitempty"`
}
CampaignDispatchArgs schedules or dispatches campaign notifications.
func (CampaignDispatchArgs) InsertOpts ¶ added in v1.0.7
func (CampaignDispatchArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when scheduling this job.
func (CampaignDispatchArgs) Kind ¶ added in v1.0.7
func (CampaignDispatchArgs) Kind() string
Kind satisfies the river.Job interface.
type CreateCustomDomainArgs ¶
type CreateCustomDomainArgs struct {
// ID of the custom domain in our system
CustomDomainID string `json:"custom_domain_id"`
}
CreateCustomDomainArgs for the worker to process the custom domain
func (CreateCustomDomainArgs) InsertOpts ¶ added in v1.0.3
func (CreateCustomDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreateCustomDomainArgs) Kind ¶
func (CreateCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type CreateDomainScanArgs ¶ added in v1.0.16
type CreateDomainScanArgs struct {
// OrganizationID is the organization that owns the onboarding
OrganizationID string `json:"organization_id"`
Domains []string `json:"domains"`
}
CreateDomainScanArgs for the worker to scan the domains provided by the organization
func (CreateDomainScanArgs) InsertOpts ¶ added in v1.0.16
func (CreateDomainScanArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreateDomainScanArgs) Kind ¶ added in v1.0.16
func (CreateDomainScanArgs) Kind() string
Kind satisfies the river.Job interface
type CreatePirschDomainArgs ¶
type CreatePirschDomainArgs struct {
// TrustCenterID is the ID of the trust center to create a Pirsch domain for
TrustCenterID string `json:"trust_center_id"`
}
CreatePirschDomainArgs for the worker to process the pirsch domain creation
func (CreatePirschDomainArgs) InsertOpts ¶ added in v1.0.3
func (CreatePirschDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreatePirschDomainArgs) Kind ¶
func (CreatePirschDomainArgs) Kind() string
Kind satisfies the river.Job interface
type CreatePreviewDomainArgs ¶
type CreatePreviewDomainArgs struct {
// TrustCenterID is the ID of the trust center to create a preview domain for
TrustCenterID string `json:"trust_center_id"`
// TrustCenterPreviewZoneID is the cloudflare zone id for the trust center preview domain
TrustCenterPreviewZoneID string `json:"trust_center_preview_zone_id"`
// TrustCenterCnameTarget is the cname target for the trust center
TrustCenterCnameTarget string `json:"trust_center_cname_target"`
}
CreatePreviewDomainArgs for the worker to process the preview domain creation
func (CreatePreviewDomainArgs) InsertOpts ¶ added in v1.0.3
func (CreatePreviewDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreatePreviewDomainArgs) Kind ¶
func (CreatePreviewDomainArgs) Kind() string
Kind satisfies the river.Job interface
type CreatePreviewDomainSSLAcmeArgs ¶ added in v1.0.15
type CreatePreviewDomainSSLAcmeArgs struct {
// ID of the custom domain in our system
CustomDomainID string `json:"custom_domain_id"`
// TrustCenterID is the ID of the trust center this preview domain belongs to
TrustCenterID string `json:"trust_center_id"`
// TrustCenterPreviewZoneID is the cloudflare zone id for this preview domain
TrustCenterPreviewZoneID string `json:"trust_center_preview_zone_id"`
}
CreatePreviewDomainSSLAcmeArgs for the worker to process the preview domain and add it's acme content
When creating a preview domain, since we do not require the user to add the cnames and others to verify the domain, we add it as a subdomain of ours, Cloudflare proceeds to automatically generate the ssl certificate
but the problem here is that it automatically goes into an "initializing" state and we do not want to wait in the "create preview worker" job for say a minute or more to get the acme challenge content
func (CreatePreviewDomainSSLAcmeArgs) InsertOpts ¶ added in v1.0.15
func (CreatePreviewDomainSSLAcmeArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreatePreviewDomainSSLAcmeArgs) Kind ¶ added in v1.0.15
func (CreatePreviewDomainSSLAcmeArgs) Kind() string
Kind satisfies the river.Job interface
type CreateTaskArgs ¶
type CreateTaskArgs struct {
// OrganizationID is the organization that owns the task (required)
OrganizationID string `json:"organization_id"`
// Title of the task (required)
Title string `json:"title"`
// Description/details of the task (required)
Description string `json:"description"`
// Category of the task (optional) - e.g. "Policy Review", "Evidence Upload", "Onboarding"
Category *string `json:"category,omitempty"`
// AssigneeID is the user to assign the task to (optional)
AssigneeID *string `json:"assignee_id,omitempty"`
// AssignerID is the user who created/assigned the task (optional)
AssignerID *string `json:"assigner_id,omitempty"`
// DueDate for the task (optional)
DueDate *models.DateTime `json:"due_date,omitempty"`
// InternalPolicyIDs to link the task to internal policies (optional)
InternalPolicyIDs []string `json:"internal_policy_ids,omitempty"`
// Tags associated with the task (optional)
Tags []string `json:"tags,omitempty"`
// ScheduledAt allows scheduling the job for a future time (optional)
ScheduledAt *time.Time `json:"scheduled_at,omitempty"`
}
CreateTaskArgs for the worker to process This is a generic task creation job that accepts pre-built task details. External systems (schedulers, triggers, polling jobs) should handle business logic like fetching policies, selecting assignees, building descriptions, etc.
func (CreateTaskArgs) InsertOpts ¶ added in v1.0.3
func (CreateTaskArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (CreateTaskArgs) Kind ¶
func (CreateTaskArgs) Kind() string
Kind satisfies the river.Job interface
type DeleteCustomDomainArgs ¶
type DeleteCustomDomainArgs struct {
// CustomDomainID of the id of the custom domain in the system
CustomDomainID string `json:"custom_domain_id"`
// DNSVerificationID of the dns verification id in the system
DNSVerificationID string `json:"dns_verification_id"`
// CloudflareCustomHostnameID of the cloudflare custom hostname id to delete
CloudflareCustomHostnameID string `json:"cloudflare_custom_hostname_id"`
// CloudflareZoneID of the cloudflare zone id where the custom domain is located
CloudflareZoneID string `json:"cloudflare_zone_id"`
}
DeleteCustomDomainArgs for the worker to process the custom domain
func (DeleteCustomDomainArgs) InsertOpts ¶ added in v1.0.3
func (DeleteCustomDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (DeleteCustomDomainArgs) Kind ¶
func (DeleteCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type DeletePirschDomainArgs ¶
type DeletePirschDomainArgs struct {
// PirschDomainID is the ID of the Pirsch domain to delete
PirschDomainID string `json:"pirsch_domain_id"`
}
DeletePirschDomainArgs for the worker to delete a Pirsch domain
func (DeletePirschDomainArgs) InsertOpts ¶ added in v1.0.3
func (DeletePirschDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (DeletePirschDomainArgs) Kind ¶
func (DeletePirschDomainArgs) Kind() string
Kind satisfies the river.Job interface
type DeletePreviewDomainArgs ¶
type DeletePreviewDomainArgs struct {
// CustomDomainID is the ID of the custom domain to delete
CustomDomainID string `json:"custom_domain_id"`
// TrustCenterPreviewZoneID is the cloudflare zone id for the trust center preview domain
TrustCenterPreviewZoneID string `json:"trust_center_preview_zone_id"`
}
DeletePreviewDomainArgs for the worker to process the preview domain deletion
func (DeletePreviewDomainArgs) InsertOpts ¶ added in v1.0.3
func (DeletePreviewDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (DeletePreviewDomainArgs) Kind ¶
func (DeletePreviewDomainArgs) Kind() string
Kind satisfies the river.Job interface
type ExportContentArgs ¶
type ExportContentArgs struct {
// ExportID is the ID of the export job
ExportID string `json:"export_id,omitempty"`
// UserID of the user who requested the export (for system admin context)
UserID string `json:"user_id,omitempty"`
// OrganizationID of the organization context for the export
OrganizationID string `json:"organization_id,omitempty"`
// Mode is the export mode (e.g., flat or folder)
Mode enums.ExportMode `json:"mode,omitempty"`
// ExportMetadata contains additional metadata for the export
ExportMetadata *models.ExportMetadata `json:"export_metadata,omitempty"`
}
ExportContentArgs for the worker to process and update the record for the updated content
func (ExportContentArgs) InsertOpts ¶ added in v1.0.3
func (ExportContentArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (ExportContentArgs) Kind ¶
func (ExportContentArgs) Kind() string
Kind satisfies the river.Job interface
type OrganizationDeletionArgs ¶ added in v1.0.19
type OrganizationDeletionArgs struct{}
OrganizationDeletionReminderArgs for the periodic worker to delete an organization
func (OrganizationDeletionArgs) InsertOpts ¶ added in v1.0.19
func (OrganizationDeletionArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (OrganizationDeletionArgs) Kind ¶ added in v1.0.19
func (OrganizationDeletionArgs) Kind() string
Kind satisfies the river.Job interface
type OrganizationDeletionReminderArgs ¶ added in v1.0.19
type OrganizationDeletionReminderArgs struct{}
OrganizationDeletionReminderArgs for the peridoci worker to poll the orgs without payment methods and send notifications/emails to them if they are yet to add a card after some period of time
func (OrganizationDeletionReminderArgs) InsertOpts ¶ added in v1.0.19
func (OrganizationDeletionReminderArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (OrganizationDeletionReminderArgs) Kind ¶ added in v1.0.19
func (OrganizationDeletionReminderArgs) Kind() string
Kind satisfies the river.Job interface
type RetrieveDomainScanArgs ¶ added in v1.0.17
type RetrieveDomainScanArgs struct {
// OrganizationID is the organization that owns the onboarding
OrganizationID string `json:"organization_id"`
// ScanResultID is the id from cloudflare radar
ScanResultID string `json:"scan_result_id"`
}
RetrieveDomainScanArgs for the worker to poll the domain result from cloudflare before creating the notification
func (RetrieveDomainScanArgs) InsertOpts ¶ added in v1.0.17
func (RetrieveDomainScanArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (RetrieveDomainScanArgs) Kind ¶ added in v1.0.17
func (RetrieveDomainScanArgs) Kind() string
Kind satisfies the river.Job interface
type UpdatePirschDomainArgs ¶
type UpdatePirschDomainArgs struct {
// TrustCenterID is the ID of the trust center to update the Pirsch domain for
TrustCenterID string `json:"trust_center_id"`
}
UpdatePirschDomainArgs for the worker to update the pirsch domain
func (UpdatePirschDomainArgs) InsertOpts ¶ added in v1.0.3
func (UpdatePirschDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (UpdatePirschDomainArgs) Kind ¶
func (UpdatePirschDomainArgs) Kind() string
Kind satisfies the river.Job interface
type ValidateCustomDomainArgs ¶
type ValidateCustomDomainArgs struct {
CustomDomainID string `json:"custom_domain_id"`
}
ValidateCustomDomainArgs for the worker to process the custom domain
func (ValidateCustomDomainArgs) InsertOpts ¶ added in v1.0.3
func (ValidateCustomDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (ValidateCustomDomainArgs) Kind ¶
func (ValidateCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type ValidatePreviewDomainArgs ¶
type ValidatePreviewDomainArgs struct {
// TrustCenterID is the ID of the trust center to validate the preview domain for
TrustCenterID string `json:"trust_center_id"`
// TrustCenterPreviewZoneID is the cloudflare zone id for the trust center preview domain
TrustCenterPreviewZoneID string `json:"trust_center_preview_zone_id"`
}
ValidatePreviewDomainArgs for the worker to process the preview domain creation
func (ValidatePreviewDomainArgs) InsertOpts ¶ added in v1.0.3
func (ValidatePreviewDomainArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (ValidatePreviewDomainArgs) Kind ¶
func (ValidatePreviewDomainArgs) Kind() string
Kind satisfies the river.Job interface
type WatermarkDocArgs ¶
type WatermarkDocArgs struct {
// TrustCenterDocumentID is the ID of the trust center document to watermark
TrustCenterDocumentID string `json:"trust_center_document_id"`
}
WatermarkDocArgs for the worker to process watermarking of a document
func (WatermarkDocArgs) InsertOpts ¶ added in v1.0.3
func (WatermarkDocArgs) InsertOpts() river.InsertOpts
InsertOpts provides the default configuration when processing this job.
func (WatermarkDocArgs) Kind ¶
func (WatermarkDocArgs) Kind() string
Kind satisfies the river.Job interface