entity

package
v0.0.0-...-9af3b39 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckIndex

type CheckIndex struct {
	ID      string            `json:"id"`      // Hash
	IndexID string            `json:"indexID"` // Index ID
	Files   []*CheckIndexFile `json:"files"`   // File IDs
}

CheckIndex 描述了一个 Index 对应的数据 ID,包括 File ID 和 Chunk ID。

该结构体在数据同步云端时根据本地 Latest Index 生成,在云端服务上用于校验数据完整性。

该数据结构仅保存 ID,因此不会影响端到端加密的安全性,不会对数据安全造成任何影响。

存放路径:repo/check/indexes/{id}。

type CheckIndexFile

type CheckIndexFile struct {
	ID     string   `json:"id"`     // File ID
	Chunks []string `json:"chunks"` // Chunk IDs
}

type CheckReport

type CheckReport struct {
	CheckTime      int64    `json:"checkTime"`
	CheckCount     int      `json:"checkCount"`
	FixCount       int      `json:"fixCount"`
	MissingObjects []string `json:"missingObjects"`
}

type Chunk

type Chunk struct {
	ID   string `json:"id"`
	Data []byte `json:"data"` // 实际的数据
}

Chunk 描述了文件分块

type File

type File struct {
	ID      string   `json:"id"`      // Hash
	Path    string   `json:"path"`    // 文件路径
	Size    int64    `json:"size"`    // 文件大小
	Updated int64    `json:"updated"` // 最后更新时间
	Chunks  []string `json:"chunks"`  // 文件分块列表
}

File 描述了文件。

func NewFile

func NewFile(path string, size int64, updated int64) (ret *File)

func (*File) SecUpdated

func (f *File) SecUpdated() int64

type Index

type Index struct {
	ID           string   `json:"id"`           // Hash
	Memo         string   `json:"memo"`         // 索引备注
	Created      int64    `json:"created"`      // 索引时间
	Files        []string `json:"files"`        // 文件列表
	Count        int      `json:"count"`        // 文件总数
	Size         int64    `json:"size"`         // 文件总大小
	SystemID     string   `json:"systemID"`     // 系统 ID
	SystemName   string   `json:"systemName"`   // 系统名称
	SystemOS     string   `json:"systemOS"`     // 系统操作系统
	CheckIndexID string   `json:"checkIndexID"` // Check Index ID
}

Index 描述了快照索引。

func (*Index) String

func (index *Index) String() string

type ObjectInfo

type ObjectInfo struct {
	Path string
	Size int64
}

type PurgeStat

type PurgeStat struct {
	Objects int
	Indexes int
	Size    int64
}

Jump to

Keyboard shortcuts

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