Documentation ¶
Index ¶
- Variables
- func AddShare(hash, owner, user string)
- func AddTag(tags []string, id string, repo string) error
- func CheckAuthID(token string) (name string)
- func CheckRepo(owner string, repo []string, hash string) (val int)
- func CheckRepoOfHash(hash string) (repo string)
- func CheckShare(hash, user string) (shared bool)
- func CleanAuthID()
- func CleanSearchIndex()
- func CleanTokens()
- func CleanUserFiles()
- func Close()
- func CountMd5(hash string) (md5 int)
- func CountTotal(user string) (total int)
- func DebugDatabase()
- func Delete(owner, repo, key string) (total int)
- func Edit(owner, key, value string, options ...map[string]string)
- func Exists(str string, list []string) bool
- func FileField(hash, field string) (list []string)
- func FileSignatures(hash string) (list map[string]string)
- func GetFileScope(hash, owner string) (scope []string)
- func GetUserToken(user string) (token string)
- func Hash(key string) (md5, sha256 string)
- func Info(id string) map[string]string
- func InitDB() *bolt.DB
- func IntersectOfTags(tags []string, repo string) (list []string)
- func IsFileExists(filename string) bool
- func IsPublic(hash string) (public bool)
- func LastHash(name, t string) (hash string)
- func MakePrivate(hash, owner string)
- func MakePublic(hash, owner string)
- func NameByHash(hash string) (name string)
- func OwnerFilesByRepo(owner string, repo string) (list []string)
- func OwnerHadThisFile(owner, md5 string) (has bool)
- func PrintBucketName(buckets []string) (path string)
- func PrintBuckets(b *bolt.Bucket, parents []string)
- func QuotaGet(user string) (quota int)
- func QuotaLeft(user string) int
- func QuotaSet(user, quota string)
- func QuotaUsageCorrect()
- func QuotaUsageGet(user string) (stored int)
- func QuotaUsageSet(user string, value int)
- func RebuildShare(hash, owner string)
- func RegisterUser(name, key []byte)
- func RemoveShare(hash, owner, user string)
- func RemoveTags(key, list string) error
- func SaveAuthID(name, token string)
- func SaveToken(name, token string)
- func SaveTorrent(hash, torrent []byte)
- func SearchByOneTag(tag string, repo string) (list []string)
- func SearchName(query string) (list []string)
- func Tag(query string) (list []string, err error)
- func TokenFilesByRepo(token string, repo string) (list []string)
- func TokenOwner(token string) (name string)
- func Torrent(hash []byte) (val []byte)
- func UnionByTags(tags []string, repo string) (list []string)
- func UserFile(owner, file string) (list []string)
- func UserKey(name string) (key string)
- func UserKeys(name string) (keys []string)
- func Write(owner, key, value string, options ...map[string]string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddShare ¶
func AddShare(hash, owner, user string)
AddShare adds user to share scope of file if the file wasn't shared with him yet
func CheckAuthID ¶
func CheckRepoOfHash ¶
CheckRepoOfHash return the type of file by its hash
func CheckShare ¶
CheckShare returns true if user has access to file, otherwise - false
func CleanAuthID ¶
func CleanAuthID()
func CleanSearchIndex ¶
func CleanSearchIndex()
func CleanTokens ¶
func CleanTokens()
func CleanUserFiles ¶
func CleanUserFiles()
func CountTotal ¶
CountTotal counts and sets user's total quota usage
func DebugDatabase ¶
func DebugDatabase()
func FileSignatures ¶
FileSignatures returns map with file's owners and their signatures
func GetFileScope ¶
GetFileScope shows users with whom owner shared a file with particular hash
func GetUserToken ¶
func IntersectOfTags ¶
IntersectOfTags return IDs of files by all respective tags
func IsFileExists ¶
func MakePrivate ¶
func MakePrivate(hash, owner string)
func MakePublic ¶
func MakePublic(hash, owner string)
func NameByHash ¶
NameByHash returns file's name by its ID
func OwnerFilesByRepo ¶
OwnerFilesByRepo returns all public files of owner from specified repo
func OwnerHadThisFile ¶
func PrintBucketName ¶
func PrintBuckets ¶
func QuotaSet ¶
func QuotaSet(user, quota string)
QuotaSet sets changes default storage quota for user
func QuotaUsageCorrect ¶
func QuotaUsageCorrect()
QuotaUsageCorrect updates saved values of quota usage according to file index table
func QuotaUsageGet ¶
QuotaUsageGet returns value of used disk quota
func QuotaUsageSet ¶
QuotaUsageSet accepts size of added/removed file and updates quota usage for user
func RebuildShare ¶
func RebuildShare(hash, owner string)
func RegisterUser ¶
func RegisterUser(name, key []byte)
func RemoveShare ¶
func RemoveShare(hash, owner, user string)
RemoveShare removes user from share scope of file if the file was shared with him
func RemoveTags ¶
RemoveTags deletes tag from index bucket and file information. It should be executed on every file deletion to keep DB consistant.
func SaveAuthID ¶
func SaveAuthID(name, token string)
func SaveTorrent ¶
func SaveTorrent(hash, torrent []byte)
SaveTorrent saves torrent file for particular template in DB for future usage to prevent regeneration same file again.
func SearchByOneTag ¶
SearchByOneTag is performs search in bucket Tags by tag
func SearchName ¶
SearchName searches for all (public/private) files of all users that have "query" substring in their names
func Tag ¶
Tag returns a list of artifacts that contains requested tags. If no records found list will be empty.
func TokenFilesByRepo ¶
TokenFilesByRepo returns all public/private/shared files of token owner from specified repo
func TokenOwner ¶
TokenOwner returns the owner of the given token
func Torrent ¶
Torrent retrieves torrent file for template from DB. If no torrent file found it returns nil.
func UnionByTags ¶
UnionByTags return list of the values by one of respective tags
func UserFile ¶
UserFile searches a file among particular user's files. It returns list of hashes of files with required name.
Types ¶
This section is empty.