Files
panel/internal/http/request/toolbox_disk.go
T
耗子 6f0593fbf8 feat: 升级 libtnb/validator v0.2.1,用上新校验能力
- 切片字段加 unique 防重复配置(域名/监听/IP/白名单/网卡/磁盘设备/
  NTP 服务器/应用标识/压缩路径/TLS 版本/索引/定时任务目标)
- 网站统计日期范围 End 加 after_or_equal:Start(结束不早于开始)
- 新增 tags_test.go:CheckRules 体检关键请求 + 全包 validate tag
  编译校验,坏规则名/语法错/未注册自定义规则在测试期即报错

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 23:11:28 +08:00

77 lines
2.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package request
// ToolboxDiskDevice 磁盘设备请求
type ToolboxDiskDevice struct {
Device string `form:"device" json:"device" validate:"required"`
}
// ToolboxDiskMount 挂载请求
type ToolboxDiskMount struct {
Device string `form:"device" json:"device" validate:"required"`
Path string `form:"path" json:"path" validate:"required && unix_path"`
WriteFstab bool `form:"write_fstab" json:"write_fstab"`
MountOption string `form:"mount_option" json:"mount_option"`
}
// ToolboxDiskUmount 卸载请求
type ToolboxDiskUmount struct {
Path string `form:"path" json:"path" validate:"required && unix_path"`
}
// ToolboxDiskFormat 格式化请求
type ToolboxDiskFormat struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required && in:ext4,ext3,xfs,btrfs"`
}
// ToolboxDiskVG 卷组请求
type ToolboxDiskVG struct {
Name string `form:"name" json:"name" validate:"required"`
Devices []string `form:"devices" json:"devices" validate:"required && unique"`
}
// ToolboxDiskLV 逻辑卷请求
type ToolboxDiskLV struct {
Name string `form:"name" json:"name" validate:"required"`
VGName string `form:"vg_name" json:"vg_name" validate:"required"`
Size int `form:"size" json:"size" validate:"required && min:1"`
}
// ToolboxDiskVGName 卷组名称请求
type ToolboxDiskVGName struct {
Name string `form:"name" json:"name" validate:"required"`
}
// ToolboxDiskLVPath 逻辑卷路径请求
type ToolboxDiskLVPath struct {
Path string `form:"path" json:"path" validate:"required && unix_path"`
}
// ToolboxDiskExtendLV 扩容逻辑卷请求
type ToolboxDiskExtendLV struct {
Path string `form:"path" json:"path" validate:"required && unix_path"`
Size int `form:"size" json:"size" validate:"required && min:1"`
Resize bool `form:"resize" json:"resize"`
}
// ToolboxDiskInit 初始化磁盘请求
type ToolboxDiskInit struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required && in:ext4,ext3,xfs,btrfs"`
}
// ToolboxDiskFstabEntry fstab 条目结构
type ToolboxDiskFstabEntry struct {
Device string `json:"device"` // 设备(UUID=xxx 或 /dev/xxx
MountPoint string `json:"mount_point"` // 挂载点
FsType string `json:"fs_type"` // 文件系统类型
Options string `json:"options"` // 挂载选项
Dump string `json:"dump"` // 备份标志
Pass string `json:"pass"` // 检查顺序
}
// ToolboxDiskFstabDelete 删除 fstab 条目请求
type ToolboxDiskFstabDelete struct {
MountPoint string `form:"mount_point" json:"mount_point" validate:"required"`
}