Documentation ¶
Index ¶
- Variables
- type Branch
- type Commit
- type DB
- func (db *DB) BranchCount(ctx context.Context) (int, error)
- func (db *DB) BranchInfo(ctx context.Context, branchName string) (branch Branch, err error)
- func (db *DB) Close() error
- func (db *DB) Create() error
- func (db *DB) DirCount(ctx context.Context) (int, error)
- func (db *DB) DirItemCount(ctx context.Context) (int, error)
- func (db *DB) FileCount(ctx context.Context) (int, error)
- func (db *DB) GetFileHash(ctx context.Context, branchName string, splitPath []string) (hash string, err error)
- func (db *DB) GetFileHashMode(ctx context.Context, branchName string, splitPath []string) (hash string, mode os.FileMode, err error)
- func (db *DB) List(ctx context.Context, branchName string, splitPath []string) (dirItems []DirItem, err error)
- func (db *DB) ListByHash(ctx context.Context, hash string) (dirItems []DirItem, err error)
- func (db *DB) NewBranch(ctx context.Context, branchName string) (exist bool, err error)
- func (db *DB) Open(ctx context.Context, branchName string, splitPath []string) (hash string, mode os.FileMode, dirItems []DirItem, err error)
- func (db *DB) Remove(ctx context.Context, branchName string, splitPath []string) (commit Commit, branch Branch, err error)
- func (db *DB) UpsertDirItem(ctx context.Context, branchName string, splitPath []string, item DirItem) (commit Commit, branch Branch, err error)
- func (db *DB) WriteBranch(ctx context.Context, branch Branch) error
- func (db *DB) WriteCommit(ctx context.Context, commit *Commit) error
- func (db *DB) WriteDir(ctx context.Context, dirItems []DirItem) (dir Dir, err error)
- func (db *DB) WriteFile(ctx context.Context, file File) error
- type Dir
- type DirItem
- func (d DirItem) GetAccessTime() uint64
- func (d DirItem) GetChangeTime() uint64
- func (d DirItem) GetCount() uint64
- func (d DirItem) GetCreateTime() uint64
- func (d DirItem) GetHash() string
- func (d DirItem) GetMode() uint64
- func (d DirItem) GetModifyTime() uint64
- func (d DirItem) GetName() string
- func (d DirItem) GetSize() uint64
- func (d DirItem) GetTotalCount() uint64
- type File
- type FileOrDir
- type IBranch
- type IDirItem
- type TxOrDb
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExpectedDir = errors.New("expected dir")
)
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) BranchInfo ¶
func (*DB) GetFileHash ¶
func (*DB) GetFileHashMode ¶
func (*DB) ListByHash ¶
func (*DB) UpsertDirItem ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
func NewDirFromDirItem ¶
func (Dir) TotalCount ¶
type DirItem ¶
type DirItem struct { Hash string Name string Mode uint64 Size uint64 Count uint64 TotalCount uint64 CreateTime uint64 // linux does not support it. ModifyTime uint64 ChangeTime uint64 // windows does not support it. AccessTime uint64 }
https://zhuanlan.zhihu.com/p/343682839
func NewDirItem ¶
func (DirItem) GetAccessTime ¶
func (DirItem) GetChangeTime ¶
func (DirItem) GetCreateTime ¶
func (DirItem) GetModifyTime ¶
func (DirItem) GetTotalCount ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewFileByBytes ¶
func (File) TotalCount ¶
func (i File) TotalCount() uint64
Click to show internal directories.
Click to hide internal directories.