Documentation ¶
Overview ¶
package jobs contains the jobs that can be used in the river server
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingTestDir is the error for missing test directory ErrMissingTestDir = errors.New("missing test directory in email config") // ErrMissingToken is the error for missing token ErrMissingToken = errors.New("missing resend api token, set token or use dev mode") )
Functions ¶
This section is empty.
Types ¶
type EmailArgs ¶
type EmailArgs struct { // Message is the email message to send Message newman.EmailMessage `json:"message"` }
EmailArgs for the email worker to process the job
type EmailConfig ¶
type EmailConfig struct { // DevMode is a flag to enable dev mode DevMode bool `koanf:"devMode" json:"devMode" jsonschema:"description=enable dev mode" default:"true"` // TestDir is the directory to use for dev mode TestDir string `koanf:"testDir" json:"testDir" jsonschema:"description=the directory to use for dev mode" default:"fixtures/email"` // Token is the token to use for the email provider Token string `koanf:"token" json:"token" jsonschema:"description=the token to use for the email provider"` // FromEmail is the email address to use as the sender FromEmail string `` /* 138-byte string literal not displayed */ }
EmailConfig contains the configuration for the email worker
type EmailWorker ¶
type EmailWorker struct { river.WorkerDefaults[EmailArgs] EmailConfig }
EmailWorker is a worker to send emails using the resend email provider the config defaults to dev mode, which will write the email to a file using the mock provider a token is required to send emails using the actual resend provider
Click to show internal directories.
Click to hide internal directories.