sqlite

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFileDatabase added in v0.0.6

func DeleteFileDatabase(db *sqlites.SqliteDB, fileID string) error

DeleteFileDatabase 删除文件数据

func DeleteSharedDatabase

func DeleteSharedDatabase(db *sqlites.SqliteDB, fileID string) error

DeleteSharedDatabase 删除共享数据

func DeleteSlicesDatabase added in v0.0.6

func DeleteSlicesDatabase(db *sqlites.SqliteDB, fileID string) error

DeleteSlicesDatabase 删除文件片段数据

func InitDBTable

func InitDBTable(db *sqlites.SqliteDB) error

InitDBTable 数据库表

func InsertFilesDatabase

func InsertFilesDatabase(db *sqlites.SqliteDB, fileID string, totalPieces int64, operates, status int, modTime time.Time) error

InsertFilesDatabase 插入文件数据

func InsertSharedDatabase

func InsertSharedDatabase(db *sqlites.SqliteDB, fileID, name string, size, xref int, uploadTime, modTime time.Time) error

InsertSharedDatabase 插入共享数据

func InsertSlicesDatabase

func InsertSlicesDatabase(db *sqlites.SqliteDB, fileID, sliceHash string, current, status int) error

InsertSlicesDatabase 插入文件片段数据

func SelectOneFileID

func SelectOneFileID(db *sqlites.SqliteDB, fileID string) bool

SelectOneFileID 查询指定的文件是否存在

func SelectOneSlicesDatabaseStatus

func SelectOneSlicesDatabaseStatus(db *sqlites.SqliteDB, fileID string) (*struct {
	SliceHash  string // 文件片段的哈希值
	SliceIndex int    // 文件片段的索引
}, error)

SelectOneSlicesDatabaseStatus 查询指定文件的片段数据对象信息

func SelectSharedByFileIDDatabaseStatus added in v0.0.6

func SelectSharedByFileIDDatabaseStatus(db *sqlites.SqliteDB, fileID string) (*sql.Rows, error)

SelectSharedDatabaseStatus 查询指定文件的片段数据对象信息

func SelectSharedByNameDatabaseStatus added in v0.0.6

func SelectSharedByNameDatabaseStatus(db *sqlites.SqliteDB, name string) (*sql.Rows, error)

SelectSharedDatabaseStatus 查询指定文件的片段数据对象信息

func UpdateFileDatabaseStatus

func UpdateFileDatabaseStatus(db *sqlites.SqliteDB, fileID string, operates, status int) error

UpdateFileDatabaseStatus 更新文件数据对象的状态 operates 操作(0:下载、1:上传) status 状态(0:失败、1:成功、2:待开始、3:进行中)

func UpdateSharedDatabase

func UpdateSharedDatabase(db *sqlites.SqliteDB, fileID, name string, size, xref int, uploadTime, modTime time.Time) error

UpdateSharedDatabase 更新共享数据

func UpdateSlicesDatabaseStatus

func UpdateSlicesDatabaseStatus(db *sqlites.SqliteDB, fileID, sliceHash string, status int) error

UpdateSlicesDatabaseStatus 更新文件片段数据对象的状态

Types

This section is empty.

Jump to

Keyboard shortcuts

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