mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-09-05 07:26:43 +08:00
chore(repo): 完善仓库维护与自动化 (#108)
统一 Node.js 24 LTS、CI、文档和发布工作流配置。 完善仓库维护规范、Dependabot 与贡献文档,清理生成产物并统一既有 Go 代码格式。
This commit is contained in:
@@ -6,12 +6,12 @@ import "time"
|
||||
// 任一 Notification 可订阅多个事件,EventTypes 字段存 CSV。
|
||||
// 空 EventTypes + OnSuccess/OnFailure=true 时沿用旧语义(仅备份成功/失败)。
|
||||
const (
|
||||
NotificationEventBackupSuccess = "backup_success"
|
||||
NotificationEventBackupFailed = "backup_failed"
|
||||
NotificationEventBackupSuccess = "backup_success"
|
||||
NotificationEventBackupFailed = "backup_failed"
|
||||
NotificationEventRestoreSuccess = "restore_success"
|
||||
NotificationEventRestoreFailed = "restore_failed"
|
||||
NotificationEventVerifyFailed = "verify_failed"
|
||||
NotificationEventSLAViolation = "sla_violation"
|
||||
NotificationEventVerifyFailed = "verify_failed"
|
||||
NotificationEventSLAViolation = "sla_violation"
|
||||
// NotificationEventStorageUnhealthy 存储目标连接失败(后台健康扫描触发)。
|
||||
NotificationEventStorageUnhealthy = "storage_unhealthy"
|
||||
// NotificationEventReplicationFailed 备份复制失败。
|
||||
@@ -23,13 +23,13 @@ const (
|
||||
)
|
||||
|
||||
type Notification struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Type string `gorm:"size:20;index;not null" json:"type"`
|
||||
Name string `gorm:"size:100;uniqueIndex;not null" json:"name"`
|
||||
ConfigCiphertext string `gorm:"column:config_ciphertext;type:text;not null" json:"-"`
|
||||
Enabled bool `gorm:"not null;default:true" json:"enabled"`
|
||||
OnSuccess bool `gorm:"column:on_success;not null;default:false" json:"onSuccess"`
|
||||
OnFailure bool `gorm:"column:on_failure;not null;default:true" json:"onFailure"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Type string `gorm:"size:20;index;not null" json:"type"`
|
||||
Name string `gorm:"size:100;uniqueIndex;not null" json:"name"`
|
||||
ConfigCiphertext string `gorm:"column:config_ciphertext;type:text;not null" json:"-"`
|
||||
Enabled bool `gorm:"not null;default:true" json:"enabled"`
|
||||
OnSuccess bool `gorm:"column:on_success;not null;default:false" json:"onSuccess"`
|
||||
OnFailure bool `gorm:"column:on_failure;not null;default:true" json:"onFailure"`
|
||||
// EventTypes 逗号分隔,订阅的事件类型。
|
||||
// 空 = 仅监听备份成功/失败(兼容旧配置);非空则严格按订阅触发。
|
||||
EventTypes string `gorm:"column:event_types;size:500" json:"eventTypes"`
|
||||
|
||||
Reference in New Issue
Block a user