Documentation
¶
Index ¶
Constants ¶
View Source
const ( Undefined Type = -1 TypeEmail = iota TypeQuota )
View Source
const ( StatusPending int8 = iota StatusInProgress StatusCompleted StatusFailed StatusCancelled StatusEnqueueFailed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailContent ¶
func (*EmailContent) Marshal ¶
func (c *EmailContent) Marshal() ([]byte, error)
func (*EmailContent) Unmarshal ¶
func (c *EmailContent) Unmarshal(data []byte) error
type EmailScope ¶
type EmailScope struct {
requestmeta.Metadata
Type int8 `gorm:"not null;comment:Scope Type"`
RegisterStartTime int64 `json:"register_start_time"`
RegisterEndTime int64 `json:"register_end_time"`
Recipients []string `json:"recipients"` // list of email addresses
Additional []string `json:"additional"` // additional email addresses
Scheduled int64 `json:"scheduled"` // scheduled time (unix timestamp)
Interval uint8 `json:"interval"` // interval in seconds
Limit uint64 `json:"limit"` // daily send limit
DailySent uint64 `json:"daily_sent,omitempty"`
DailyDate string `json:"daily_date,omitempty"`
}
func (*EmailScope) Marshal ¶
func (s *EmailScope) Marshal() ([]byte, error)
func (*EmailScope) Unmarshal ¶
func (s *EmailScope) Unmarshal(data []byte) error
type QuotaContent ¶
type QuotaContent struct {
ResetTraffic bool `json:"reset_traffic"` // whether to reset traffic
Days uint64 `json:"days,omitempty"` // days to add
GiftType uint8 `json:"gift_type,omitempty"` // 1: Fixed, 2: Ratio
GiftValue uint64 `json:"gift_value,omitempty"` // value of the gift type
}
func (*QuotaContent) Marshal ¶
func (c *QuotaContent) Marshal() ([]byte, error)
func (*QuotaContent) Unmarshal ¶
func (c *QuotaContent) Unmarshal(data []byte) error
type QuotaScope ¶
type QuotaScope struct {
requestmeta.Metadata
Subscribers []int64 `json:"subscribers"` // Subscribe IDs
IsActive *bool `json:"is_active"` // filter by active status
StartTime int64 `json:"start_time"` // filter by subscription start time
EndTime int64 `json:"end_time"` // filter by subscription end time
Objects []int64 `json:"recipients"` // list of user subs IDs
}
func (*QuotaScope) Marshal ¶
func (s *QuotaScope) Marshal() ([]byte, error)
func (*QuotaScope) Unmarshal ¶
func (s *QuotaScope) Unmarshal(data []byte) error
type Task ¶
type Task struct {
Id int64 `gorm:"primaryKey;autoIncrement;comment:ID"`
Type int8 `gorm:"not null;comment:Task Type"`
Scope string `gorm:"type:text;comment:Task Scope"`
Content string `gorm:"type:text;comment:Task Content"`
Status int8 `` /* 131-byte string literal not displayed */
Errors string `gorm:"type:text;comment:Task Errors"`
Total uint64 `gorm:"column:total;not null;default:0;comment:Total Number"`
Current uint64 `gorm:"column:current;not null;default:0;comment:Current Number"`
DailyDate string `gorm:"type:varchar(10);not null;default:'';comment:Email daily quota date"`
DailySent uint64 `gorm:"not null;default:0;comment:Email daily quota sent count"`
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
UpdatedAt time.Time `gorm:"comment:Update Time"`
}
type TaskError ¶ added in v1.19.0
type TaskError struct {
Id int64 `gorm:"primaryKey;autoIncrement;comment:ID"`
TaskId int64 `gorm:"not null;uniqueIndex:uk_task_error_position;index:idx_task_error_task_id;comment:Task ID"`
Position uint64 `gorm:"not null;uniqueIndex:uk_task_error_position;comment:Target position"`
Target string `gorm:"type:varchar(320);not null;default:'';comment:Failed target"`
Error string `gorm:"type:text;comment:Failure reason"`
OccurredAt int64 `gorm:"not null;default:0;comment:Failure unix timestamp"`
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
}
TaskError stores one durable execution failure without repeatedly rewriting the task.Errors JSON document as a campaign grows.
Click to show internal directories.
Click to hide internal directories.