Documentation
¶
Overview ¶
Package corejobs holds jobs definitions for riverqueue that interact with the core api
Index ¶
- Variables
- type CreateCustomDomainArgs
- type CreateCustomDomainWorker
- func (w *CreateCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *CreateCustomDomainWorker
- func (w *CreateCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *CreateCustomDomainWorker
- func (w *CreateCustomDomainWorker) WithRiverClient(cl riverqueue.JobClient) *CreateCustomDomainWorker
- func (w *CreateCustomDomainWorker) Work(ctx context.Context, job *river.Job[CreateCustomDomainArgs]) error
- type CustomDomainConfig
- type DeleteCustomDomainArgs
- type DeleteCustomDomainWorker
- func (w *DeleteCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *DeleteCustomDomainWorker
- func (w *DeleteCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *DeleteCustomDomainWorker
- func (w *DeleteCustomDomainWorker) Work(ctx context.Context, job *river.Job[DeleteCustomDomainArgs]) error
- type DeleteExportContentArgs
- type DeleteExportContentWorker
- type DeleteExportWorkerConfig
- type ExportContentArgs
- type ExportContentWorker
- type ExportWorkerConfig
- type MissingRequiredArgError
- type ValidateCustomDomainArgs
- type ValidateCustomDomainWorker
- func (w *ValidateCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *ValidateCustomDomainWorker
- func (w *ValidateCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *ValidateCustomDomainWorker
- func (w *ValidateCustomDomainWorker) Work(ctx context.Context, job *river.Job[ValidateCustomDomainArgs]) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnexpectedStatus is returned when an HTTP request returns a status code other than 200 ErrUnexpectedStatus = errors.New("unexpected HTTP status") // ErrGraphQLMessage is returned when an error message exists in the response ErrGraphQLMessage = errors.New("GraphQL error") // ErrUnknownGraphQLError is returned when an GraphQL error occurs but no specific message is available ErrUnknownGraphQLError = errors.New("an unknown error occurred") // ErrMissingRoot is returned when the GraphQL response is missing the expected root field ErrMissingRoot = errors.New("missing root in response") // ErrMissingEdges is returned when the response is missing the edges field expected for the data ErrMissingEdges = errors.New("missing edges in response") // ErrMissingPageInfo is returned when the response is missing pagination data ErrMissingPageInfo = errors.New("missing pageInfo in response") // ErrMissingHasNextPage is returned when pagination data is missing the hasNextPage field ErrMissingHasNextPage = errors.New("missing hasNextPage in pageInfo") // ErrMissingEndCursor is returned when pagination data is missing the endCursor field needed for pagination ErrMissingEndCursor = errors.New("missing endCursor in pageInfo") )
var ( // ErrDomainVerificationAlreadyExists is returned when a custom domain already has a verification member ErrDomainVerificationAlreadyExists = errors.New("custom domain already has a verification member") )
Functions ¶
This section is empty.
Types ¶
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) Kind ¶
func (CreateCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type CreateCustomDomainWorker ¶
type CreateCustomDomainWorker struct { river.WorkerDefaults[CreateCustomDomainArgs] Config CustomDomainConfig // contains filtered or unexported fields }
CreateCustomDomainWorker creates a custom hostname in cloudflare, and creates and updates the records in our system
func (*CreateCustomDomainWorker) WithCloudflareClient ¶
func (w *CreateCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *CreateCustomDomainWorker
WithCloudflareClient sets the Cloudflare client for the worker and returns the worker for method chaining
func (*CreateCustomDomainWorker) WithOpenlaneClient ¶
func (w *CreateCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *CreateCustomDomainWorker
WithOpenlaneClient sets the Openlane client for the worker and returns the worker for method chaining
func (*CreateCustomDomainWorker) WithRiverClient ¶
func (w *CreateCustomDomainWorker) WithRiverClient(cl riverqueue.JobClient) *CreateCustomDomainWorker
WithRiverClient sets the River client for the worker and returns the worker for method chaining
func (*CreateCustomDomainWorker) Work ¶
func (w *CreateCustomDomainWorker) Work(ctx context.Context, job *river.Job[CreateCustomDomainArgs]) error
Work satisfies the river.Worker interface for the create custom domain worker it creates a custom domain for an organization
type CustomDomainConfig ¶
type CustomDomainConfig struct { CloudflareAPIKey string `koanf:"cloudflareApiKey" json:"cloudflareApiKey" jsonschema:"required description=the cloudflare api key"` OpenlaneAPIHost string `koanf:"openlaneAPIHost" json:"openlaneAPIHost" jsonschema:"required description=the openlane api host"` OpenlaneAPIToken string `koanf:"openlaneAPIToken" json:"openlaneAPIToken" jsonschema:"required description=the openlane api token"` DatabaseHost string `koanf:"databaseHost" json:"databaseHost" jsonschema:"required description=the database host"` }
CustomDomainConfig contains the configuration for the custom domain workers
type DeleteCustomDomainArgs ¶
type DeleteCustomDomainArgs struct { // ID of the custom domain in our system CustomDomainID string `json:"custom_domain_id"` DNSVerificationID string `json:"dns_verification_id"` CloudflareCustomHostnameID string `json:"cloudflare_custom_hostname_id"` CloudflareZoneID string `json:"cloudflare_zone_id"` }
DeleteCustomDomainArgs for the worker to process the custom domain
func (DeleteCustomDomainArgs) Kind ¶
func (DeleteCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type DeleteCustomDomainWorker ¶
type DeleteCustomDomainWorker struct { river.WorkerDefaults[DeleteCustomDomainArgs] Config CustomDomainConfig // contains filtered or unexported fields }
DeleteCustomDomainWorker delete the custom hostname from cloudflare and updates the records in our system
func (*DeleteCustomDomainWorker) WithCloudflareClient ¶
func (w *DeleteCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *DeleteCustomDomainWorker
WithCloudflareClient sets the Cloudflare client for the worker and returns the worker for method chaining
func (*DeleteCustomDomainWorker) WithOpenlaneClient ¶
func (w *DeleteCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *DeleteCustomDomainWorker
WithOpenlaneClient sets the Openlane client for the worker and returns the worker for method chaining
func (*DeleteCustomDomainWorker) Work ¶
func (w *DeleteCustomDomainWorker) Work(ctx context.Context, job *river.Job[DeleteCustomDomainArgs]) error
Work satisfies the river.Worker interface for the delete custom domain worker it deletes a custom domain for an organization
type DeleteExportContentArgs ¶ added in v0.22.3
type DeleteExportContentArgs struct { }
DeleteExportContentArgs for the worker to process deletion of exports
func (DeleteExportContentArgs) Kind ¶ added in v0.22.3
func (DeleteExportContentArgs) Kind() string
Kind satisfies the river.Job interface
type DeleteExportContentWorker ¶ added in v0.22.3
type DeleteExportContentWorker struct { river.WorkerDefaults[DeleteExportContentArgs] Config DeleteExportWorkerConfig `koanf:"config" json:"config" jsonschema:"description=the configuration for deleting exports"` // contains filtered or unexported fields }
DeleteExportContentWorker deletes exports that are older than the configured cutoff duration
func (*DeleteExportContentWorker) WithOpenlaneClient ¶ added in v0.22.3
func (w *DeleteExportContentWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *DeleteExportContentWorker
WithOpenlaneClient sets the Openlane client for the worker and returns the worker for method chaining
func (*DeleteExportContentWorker) Work ¶ added in v0.22.3
func (w *DeleteExportContentWorker) Work(ctx context.Context, _ *river.Job[DeleteExportContentArgs]) error
Work satisfies the river.Worker interface for the delete export worker it deletes exports that are older than the configured cutoff duration
type DeleteExportWorkerConfig ¶ added in v0.22.3
type DeleteExportWorkerConfig struct { OpenlaneAPIHost string `koanf:"openlaneAPIHost" json:"openlaneAPIHost" jsonschema:"required description=the openlane api host"` OpenlaneAPIToken string `koanf:"openlaneAPIToken" json:"openlaneAPIToken" jsonschema:"required description=the openlane api token"` // CutoffDuration defines the tolerance for exports. If you set 30 minutes, all exports older than 30 minutes // at the time of job execution will be deleted CutoffDuration time.Duration `` /* 152-byte string literal not displayed */ }
type ExportContentArgs ¶ added in v0.22.3
type ExportContentArgs struct { // ID of the export 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"` }
ExportContentArgs for the worker to process and update the record for the updated content
func (ExportContentArgs) Kind ¶ added in v0.22.3
func (ExportContentArgs) Kind() string
Kind satisfies the river.Job interface
type ExportContentWorker ¶ added in v0.22.3
type ExportContentWorker struct { river.WorkerDefaults[ExportContentArgs] Config ExportWorkerConfig `koanf:"config" json:"config" jsonschema:"description=the configuration for exporting"` // contains filtered or unexported fields }
ExportContentWorker exports the content into csv and makes it downloadable
func (*ExportContentWorker) WithOpenlaneClient ¶ added in v0.22.3
func (w *ExportContentWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *ExportContentWorker
WithOpenlaneClient sets the Openlane client for the worker and returns the worker for method chaining
func (*ExportContentWorker) WithRequester ¶ added in v0.24.1
func (w *ExportContentWorker) WithRequester(requester *httpsling.Requester) *ExportContentWorker
WithRequester sets the httpsling requester to use for HTTP requests
func (*ExportContentWorker) Work ¶ added in v0.22.3
func (w *ExportContentWorker) Work(ctx context.Context, job *river.Job[ExportContentArgs]) error
Work satisfies the river.Worker interface for the export content worker it creates a csv, uploads it and associates it with the export
type ExportWorkerConfig ¶ added in v0.22.3
type MissingRequiredArgError ¶
type MissingRequiredArgError struct { // Arg is the required argument that was not provided Arg string `json:"arg"` // Job is the job that requires the argument Job string `json:"job"` }
MissingRequiredArgError is returned when a required argument was not provided to a job
func (*MissingRequiredArgError) Error ¶
func (e *MissingRequiredArgError) Error() string
Error returns the MissingRequiredArgError in string format
type ValidateCustomDomainArgs ¶
type ValidateCustomDomainArgs struct {
CustomDomainID string `json:"custom_domain_id"`
}
ValidateCustomDomainArgs for the worker to process the custom domain
func (ValidateCustomDomainArgs) Kind ¶
func (ValidateCustomDomainArgs) Kind() string
Kind satisfies the river.Job interface
type ValidateCustomDomainWorker ¶
type ValidateCustomDomainWorker struct { river.WorkerDefaults[ValidateCustomDomainArgs] Config CustomDomainConfig // contains filtered or unexported fields }
ValidateCustomDomainWorker checks cloudflare custom domain(s), and updates the status in our system
func (*ValidateCustomDomainWorker) WithCloudflareClient ¶
func (w *ValidateCustomDomainWorker) WithCloudflareClient(cl intcloudflare.Client) *ValidateCustomDomainWorker
func (*ValidateCustomDomainWorker) WithOpenlaneClient ¶
func (w *ValidateCustomDomainWorker) WithOpenlaneClient(cl olclient.OpenlaneClient) *ValidateCustomDomainWorker
func (*ValidateCustomDomainWorker) Work ¶
func (w *ValidateCustomDomainWorker) Work(ctx context.Context, job *river.Job[ValidateCustomDomainArgs]) error
ValidateCustomDomainConfig contains the configuration for the worker Work satisfies the river.Worker interface for the validate custom domain worker. It validates custom domains by checking their status in Cloudflare and updating our system with the current verification status.