Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is the standard error class for automatic freeze errors. Error = errs.Class("account-freeze-chore") )
Functions ¶
This section is empty.
Types ¶
type Chore ¶
Chore is a chore that checks for unpaid invoices and potentially freezes corresponding accounts.
func NewChore ¶
func NewChore(log *zap.Logger, accounts stripe.DB, payments payments.Accounts, usersDB console.Users, walletsDB storjscan.WalletsDB, paymentsDB storjscan.PaymentsDB, freezeService *console.AccountFreezeService, analytics *analytics.Service, mailService *mailservice.Service, freezeConfig console.AccountFreezeConfig, config Config, flagBots bool, externalAddress, generalRequestURL string) *Chore
NewChore is a constructor for Chore.
func (*Chore) TestSetFreezeService ¶ added in v1.78.1
func (chore *Chore) TestSetFreezeService(service *console.AccountFreezeService)
TestSetFreezeService changes the freeze service for tests.
func (*Chore) TestSetNow ¶
TestSetNow sets nowFn on chore for testing.
type Config ¶
type Config struct { Enabled bool `help:"whether to run this chore." default:"false"` Interval time.Duration `help:"How often to run this chore, which is how often unpaid invoices are checked." default:"24h"` PriceThreshold int64 `help:"The failed invoice amount (in cents) beyond which an account will not be frozen" default:"100000"` ExcludeStorjscan bool `help:"whether to exclude storjscan-paying users from automatic warn/freeze" default:"false"` EmailsEnabled bool `help:"whether to freeze event emails from this chore" default:"false"` BillingWarningEmailIntervals EmailIntervals `help:"how long to wait between the billing freeze warning emails" default:"240h,96h"` BillingFreezeEmailIntervals EmailIntervals `help:"how long to wait between the billing freeze emails" default:"720h,480h,216h"` }
Config contains configurable values for account freeze chore.
type EmailIntervals ¶ added in v1.105.2
EmailIntervals is a list of durations representing how often freeze emails are sent for a freeze event.
func (*EmailIntervals) Set ¶ added in v1.105.2
func (e *EmailIntervals) Set(s string) error
Set parses a comma-separated list of durations.
func (*EmailIntervals) String ¶ added in v1.105.2
func (e *EmailIntervals) String() string
String returns a comma-separated list of durations. e.g.: 24h,32m.
func (*EmailIntervals) Type ¶ added in v1.105.2
func (e *EmailIntervals) Type() string
Type returns the type of the pflag.Value.
Click to show internal directories.
Click to hide internal directories.