Documentation ¶
Index ¶
- type SQLite
- type SQLiteStore
- func (st *SQLiteStore) AddFileInfo(ctx context.Context, infoId, userId uint64, itemPath string, info *db.FileInfo) error
- func (st *SQLiteStore) AddRole(role string) error
- func (st *SQLiteStore) AddSharing(ctx context.Context, infoId, userId uint64, dirPath string) error
- func (st *SQLiteStore) AddUploadInfos(ctx context.Context, uploadId, userId uint64, tmpPath, filePath string, ...) error
- func (st *SQLiteStore) AddUser(ctx context.Context, user *db.User) error
- func (st *SQLiteStore) Close() error
- func (st *SQLiteStore) DelFileInfo(ctx context.Context, userID uint64, itemPath string) error
- func (st *SQLiteStore) DelRole(role string) error
- func (st *SQLiteStore) DelSharing(ctx context.Context, userId uint64, dirPath string) error
- func (st *SQLiteStore) DelUploadingInfos(ctx context.Context, userId uint64, realPath string) error
- func (st *SQLiteStore) DelUser(ctx context.Context, id uint64) error
- func (st *SQLiteStore) GetCfg(ctx context.Context) (*db.SiteConfig, error)
- func (st *SQLiteStore) GetFileInfo(ctx context.Context, itemPath string) (*db.FileInfo, error)
- func (st *SQLiteStore) GetSharingDir(ctx context.Context, hashID string) (string, error)
- func (st *SQLiteStore) GetUploadInfo(ctx context.Context, userId uint64, filePath string) (string, int64, int64, error)
- func (st *SQLiteStore) GetUser(ctx context.Context, id uint64) (*db.User, error)
- func (st *SQLiteStore) GetUserByName(ctx context.Context, name string) (*db.User, error)
- func (st *SQLiteStore) Init(ctx context.Context, rootName, rootPwd string, cfg *db.SiteConfig) error
- func (st *SQLiteStore) InitConfigTable(ctx context.Context, tx *sql.Tx, cfg *db.SiteConfig) error
- func (st *SQLiteStore) InitFileTables(ctx context.Context, tx *sql.Tx) error
- func (st *SQLiteStore) InitUserTable(ctx context.Context, tx *sql.Tx, rootName, rootPwd string) error
- func (st *SQLiteStore) IsInited() bool
- func (st *SQLiteStore) IsSharing(ctx context.Context, dirPath string) (bool, error)
- func (st *SQLiteStore) ListFileInfos(ctx context.Context, itemPaths []string) (map[string]*db.FileInfo, error)
- func (st *SQLiteStore) ListRoles() (map[string]bool, error)
- func (st *SQLiteStore) ListSharingsByLocation(ctx context.Context, location string) (map[string]string, error)
- func (st *SQLiteStore) ListUploadInfos(ctx context.Context, userId uint64) ([]*db.UploadInfo, error)
- func (st *SQLiteStore) ListUserIDs(ctx context.Context) (map[string]string, error)
- func (st *SQLiteStore) ListUsers(ctx context.Context) ([]*db.User, error)
- func (st *SQLiteStore) Lock()
- func (st *SQLiteStore) MoveFileInfo(ctx context.Context, userId uint64, oldPath, newPath string, isDir bool) error
- func (st *SQLiteStore) MoveUploadingInfos(ctx context.Context, infoId, userId uint64, uploadPath, itemPath string) error
- func (st *SQLiteStore) RLock()
- func (st *SQLiteStore) RUnlock()
- func (st *SQLiteStore) ResetUsed(ctx context.Context, id uint64, used int64) error
- func (st *SQLiteStore) SetClientCfg(ctx context.Context, cfg *db.ClientConfig) error
- func (st *SQLiteStore) SetInfo(ctx context.Context, id uint64, user *db.User) error
- func (st *SQLiteStore) SetPreferences(ctx context.Context, id uint64, prefers *db.Preferences) error
- func (st *SQLiteStore) SetPwd(ctx context.Context, id uint64, pwd string) error
- func (st *SQLiteStore) SetSha1(ctx context.Context, itemPath, sign string) error
- func (st *SQLiteStore) SetUploadInfo(ctx context.Context, userId uint64, filePath string, newUploaded int64) error
- func (st *SQLiteStore) SetUsed(ctx context.Context, id uint64, incr bool, capacity int64) error
- func (st *SQLiteStore) Unlock()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(db db.IDB) (*SQLiteStore, error)
func (*SQLiteStore) AddFileInfo ¶
func (*SQLiteStore) AddRole ¶
func (st *SQLiteStore) AddRole(role string) error
func (*SQLiteStore) AddSharing ¶
func (*SQLiteStore) AddUploadInfos ¶
func (*SQLiteStore) Close ¶
func (st *SQLiteStore) Close() error
func (*SQLiteStore) DelFileInfo ¶
func (*SQLiteStore) DelRole ¶
func (st *SQLiteStore) DelRole(role string) error
func (*SQLiteStore) DelSharing ¶
func (*SQLiteStore) DelUploadingInfos ¶
func (*SQLiteStore) GetCfg ¶
func (st *SQLiteStore) GetCfg(ctx context.Context) (*db.SiteConfig, error)
func (*SQLiteStore) GetFileInfo ¶
func (*SQLiteStore) GetSharingDir ¶
func (*SQLiteStore) GetUploadInfo ¶
func (*SQLiteStore) GetUserByName ¶
func (*SQLiteStore) Init ¶
func (st *SQLiteStore) Init(ctx context.Context, rootName, rootPwd string, cfg *db.SiteConfig) error
func (*SQLiteStore) InitConfigTable ¶
func (st *SQLiteStore) InitConfigTable(ctx context.Context, tx *sql.Tx, cfg *db.SiteConfig) error
func (*SQLiteStore) InitFileTables ¶
func (*SQLiteStore) InitUserTable ¶
func (*SQLiteStore) IsInited ¶
func (st *SQLiteStore) IsInited() bool
func (*SQLiteStore) ListFileInfos ¶
func (*SQLiteStore) ListSharingsByLocation ¶
func (*SQLiteStore) ListUploadInfos ¶
func (st *SQLiteStore) ListUploadInfos(ctx context.Context, userId uint64) ([]*db.UploadInfo, error)
func (*SQLiteStore) ListUserIDs ¶
func (*SQLiteStore) Lock ¶
func (st *SQLiteStore) Lock()
func (*SQLiteStore) MoveFileInfo ¶
func (*SQLiteStore) MoveUploadingInfos ¶
func (*SQLiteStore) RLock ¶
func (st *SQLiteStore) RLock()
func (*SQLiteStore) RUnlock ¶
func (st *SQLiteStore) RUnlock()
func (*SQLiteStore) SetClientCfg ¶
func (st *SQLiteStore) SetClientCfg(ctx context.Context, cfg *db.ClientConfig) error
func (*SQLiteStore) SetPreferences ¶
func (st *SQLiteStore) SetPreferences(ctx context.Context, id uint64, prefers *db.Preferences) error
func (*SQLiteStore) SetSha1 ¶
func (st *SQLiteStore) SetSha1(ctx context.Context, itemPath, sign string) error
func (*SQLiteStore) SetUploadInfo ¶
func (*SQLiteStore) Unlock ¶
func (st *SQLiteStore) Unlock()
Click to show internal directories.
Click to hide internal directories.