model

package
v0.0.0-...-19febc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageSize = "pageSize"
	PageNum  = "pageNum"
)
View Source
const (
	PageSizeD = 10
	PageNumD  = 1
)

默认值

Variables

This section is empty.

Functions

func PageFilter

func PageFilter(num, size int, data []interface{}) (int, []interface{}, error)

PageFilter 分页

Types

type BackupInfo

type BackupInfo struct {
	RepositoryName           string    `json:"repositoryName"`           //仓库名称
	SnapshotsNum             int       `json:"snapshotsNum"`             //快照数量
	FileTotal                int       `json:"fileTotal"`                //总文件数
	DataSize                 uint64    `json:"dataSize"`                 //总数据量
	DataSizeStr              string    `json:"dataSizeStr"`              //总数据量
	DataDay                  string    `json:"dataDay"`                  //数据保护天数
	Time                     time.Time `json:"time"`                     // 统计时间
	Duration                 string    `json:"duration"`                 //统计耗时
	CompressionSpaceSaving   string    `json:"compressionSpaceSaving"`   // 压缩率
	TotalUncompressedSize    uint64    `json:"totalUncompressedSize"`    // 未压缩数据量
	TotalUncompressedSizeStr string    `json:"TotalUncompressedSizeStr"` // 未压缩数据量
}

BackupInfo 备份信息

type BoardInfo

type BoardInfo struct {
	PlanInfo       PlanInfo       `json:"planInfo"`
	RepositoryInfo RepositoryInfo `json:"repositoryInfo"`
	BackupInfo     BackupInfo     `json:"backupInfo"`  //汇总备份数据明细
	BackupInfos    []BackupInfo   `json:"backupInfos"` //每个仓库备份数据明细
}

type DumpInfo

type DumpInfo struct {
	Filename string `json:"filename"`
	Type     string `json:"type"` // dir / file
	Mode     int    `json:"mode"`
}

type ErrorUpdate

type ErrorUpdate struct {
	MessageType string `json:"messageType"` // "error"
	Error       string `json:"error"`       // 错误信息
	During      string `json:"during"`      // 错误类型
	Item        string `json:"item"`        // 错误目标
}

ErrorUpdate 错误

type FileInfo

type FileInfo struct {
	IsDir      bool   `json:"isDir"`
	Name       string `json:"name"`
	Path       string `json:"path"`
	Mode       string `json:"mode"`       // 权限
	ModTime    string `json:"modTime"`    // 修改时间
	CreateTime string `json:"createTime"` // 创建时间
	Size       int64  `json:"size"`       // 大小
	Gid        int    `json:"gid"`
	Uid        int    `json:"uid"`
}

type LockInfo

type LockInfo struct {
	Time      time.Time `json:"time"`
	Exclusive bool      `json:"exclusive"`
	Hostname  string    `json:"hostname"`
	Username  string    `json:"username"`
	PID       int       `json:"pid"`
	UID       uint32    `json:"uid,omitempty"`
	GID       uint32    `json:"gid,omitempty"`
}

type LoginData

type LoginData struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Code     string `json:"code"` // otp 验证码
}

type OtpInfo

type OtpInfo struct {
	Secret   string `json:"secret"`
	Code     string `json:"code"`
	Interval int    `json:"interval"`
}

type Page

type Page struct {
	Total    int         `json:"total"`    // 数据总量
	PageSize int         `json:"pageSize"` // 每页大小
	PageNum  int         `json:"pageNum"`  // 页码
	Items    interface{} `json:"items"`    // 数据列表
}

func PageParam

func PageParam(ctx *context.Context) *Page

type PlanInfo

type PlanInfo struct {
	Total        int `json:"total"`        // 计划总数
	RunningCount int `json:"runningCount"` // 运行中数量
}

PlanInfo 计划信息

type RePwdData

type RePwdData struct {
	OldPassword string `json:"oldPassword"`
	Password    string `json:"password"`
}

type RepoStatus

type RepoStatus struct {
	Id     int    `json:"id"`
	Status bool   `json:"status"`
	Errmsg string `json:"errmsg"`
}

type RepositoryInfo

type RepositoryInfo struct {
	Total        int `json:"total"`        // 仓库总数
	RunningCount int `json:"runningCount"` // 运行中数量
}

RepositoryInfo 仓库信息

type RestoreInfo

type RestoreInfo struct {
	Exclude  string `json:"exclude"`
	IExclude string `json:"iExclude"`
	Include  string `json:"include"`
	IInclude string `json:"iInclude"`
	Target   string `json:"target"`
	Hosts    string `json:"hosts"`
	Paths    string `json:"paths"`
	Tags     string `json:"tags"`
	Verify   bool   `json:"verify"`
}

type StatusUpdate

type StatusUpdate struct {
	MessageType      string   `json:"messageType"`        // "status"
	SecondsElapsed   string   `json:"secondsElapsed"`     // 已用时间
	SecondsRemaining string   `json:"secondsRemaining"`   // 剩余时间
	PercentDone      float64  `json:"percentDone"`        // 进度
	TotalFiles       uint64   `json:"totalFiles"`         // 文件总数
	FilesDone        uint64   `json:"filesDone"`          // 完成文件数
	TotalBytes       string   `json:"totalBytes"`         // 文件总大小
	BytesDone        string   `json:"bytesDone"`          // 完成文件大小
	ErrorCount       uint     `json:"errorCount"`         // 错误数量
	CurrentFiles     []string `json:"currentFiles"`       // 当前文件列表
	AvgSpeed         string   `json:"avgSpeed,omitempty"` //平均速度
}

StatusUpdate 进度

type SummaryOutput

type SummaryOutput struct {
	MessageType         string `json:"messageType"` // "summary"
	FilesNew            uint   `json:"filesNew"`
	FilesChanged        uint   `json:"filesChanged"`
	FilesUnmodified     uint   `json:"filesUnmodified"`
	DirsNew             uint   `json:"dirsNew"`
	DirsChanged         uint   `json:"dirsChanged"`
	DirsUnmodified      uint   `json:"dirsUnmodified"`
	DataBlobs           int    `json:"dataBlobs"`
	TreeBlobs           int    `json:"treeBlobs"`
	DataAdded           string `json:"dataAdded"`            //本次新增文件大小
	TotalFilesProcessed uint   `json:"totalFiles_processed"` // 文件总数
	TotalBytesProcessed string `json:"totalBytes_processed"` // 文件总大小
	TotalDuration       string `json:"totalDuration"`        // 总耗时 in seconds
	SnapshotID          string `json:"snapshotId"`
	DryRun              bool   `json:"dryRun,omitempty"` //
}

SummaryOutput 备份完成汇总

type TokenInfo

type TokenInfo struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expiresAt"`
}

type Userinfo

type Userinfo struct {
	Id        int        `json:"id"`
	Username  string     `json:"userName"`
	NickName  string     `json:"nickName"`
	Email     string     `json:"email"`
	Phone     string     `json:"phone"`
	LastLogin string     `json:"lastLogin"`
	Mfa       bool       `json:"mfa"`
	Token     *TokenInfo `json:"token"`
}

type VerboseUpdate

type VerboseUpdate struct {
	MessageType  string `json:"messageType"` // "verbose_status"
	Action       string `json:"action"`
	Item         string `json:"item"`
	Duration     string `json:"duration"`     // 持续时间 in seconds
	DataSize     string `json:"dataSize"`     // 数据量
	MetadataSize string `json:"metadataSize"` // 元数据量
	TotalFiles   uint   `json:"totalFiles"`   // 总文件数
}

VerboseUpdate 完成项

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL