Versions in this module Expand all Collapse all v0 v0.9.0 Oct 3, 2017 Changes in this version + const CurrentDBVersion + func GenCryptoPasswordHash(password string, makeKeyHash bool, keyHashOpts string) (key []byte, keyHash []byte, keyHashCombo string, err error) + func GenLoginPasswordHash(unsaltedPassword string) (salt string, saltedhash []byte, err error) + func VerifyCryptoPassword(password string, keyHashCombo string) ([]byte, error) + func VerifyLoginPassword(unsaltedPassowrd string, salt string, saltedHash []byte) bool + type FileChunk struct + Chunk []byte + ChunkHash string + ChunkNumber int + FileID int + VersionID int + type FileInfo struct + CurrentVersion FileVersionInfo + FileID int + FileName string + IsDir bool + UserID int + type FileStats struct + ChunkCount int + HashString string + IsDir bool + LastMod int64 + Permissions uint32 + func CalcFileHashInfo(maxChunkSize int64, filename string) (stats FileStats, e error) + type FileVersionInfo struct + ChunkCount int + FileHash string + LastMod int64 + Permissions uint32 + VersionID int + VersionNumber int + type Storage struct + ChunkSize int64 + func NewStorage(dbPath string) (*Storage, error) + func (s *Storage) AddFileChunk(userID int, fileID int, versionID int, chunkNumber int, chunkHash string, ...) (*FileChunk, error) + func (s *Storage) AddFileInfo(userID int, filename string, isDir bool, permissions uint32, lastMod int64, ...) (*FileInfo, error) + func (s *Storage) AddUser(username string, salt string, saltedHash []byte, quota int) (*User, error) + func (s *Storage) Close() + func (s *Storage) CreateTables() error + func (s *Storage) GetAllUserFileInfos(userID int) ([]FileInfo, error) + func (s *Storage) GetDBVersion() (int, error) + func (s *Storage) GetFileChunk(fileID int, chunkNumber int, versionID int) (fc *FileChunk, e error) + func (s *Storage) GetFileChunkInfos(userID int, fileID int, versionID int) ([]FileChunk, error) + func (s *Storage) GetFileInfo(userID int, fileID int) (*FileInfo, error) + func (s *Storage) GetFileInfoByName(userID int, filename string) (*FileInfo, error) + func (s *Storage) GetFileVersions(fileID int) ([]FileVersionInfo, error) + func (s *Storage) GetMissingChunkNumbersForFile(userID int, fileID int) ([]int, error) + func (s *Storage) GetUser(username string) (*User, error) + func (s *Storage) GetUserStats(userID int) (*UserStats, error) + func (s *Storage) IsUsernameFree(username string) (bool, error) + func (s *Storage) RemoveFile(userID, fileID int) error + func (s *Storage) RemoveFileChunk(userID int, fileID int, versionID int, chunkNumber int) (bool, error) + func (s *Storage) RemoveFileInfo(fileID int) error + func (s *Storage) RemoveFileVersions(userID, fileID, minVersion, maxVersion int) error + func (s *Storage) RemoveUser(username string) error + func (s *Storage) SetUserQuota(userID int, quota int) error + func (s *Storage) SetUserStats(userID int, quota int, allocated int, revision int) error + func (s *Storage) TagNewFileVersion(userID int, fileID int, permissions uint32, lastMod int64, chunkCount int, ...) (*FileInfo, error) + func (s *Storage) UpdateUser(userID int, name string, salt string, saltedHash []byte, cryptoHash []byte, ...) error + func (s *Storage) UpdateUserCryptoHash(userID int, cryptoHash []byte) error + func (s *Storage) UpdateUserStats(userID int, allocDelta int) error + type User struct + CryptoHash []byte + ID int + Name string + Salt string + SaltedHash []byte + type UserStats struct + Allocated int + Quota int + Revision int