Documentation ¶
Overview ¶
Define all Database Models here
Index ¶
- func AddUserToGroup(username string, groupname string) error
- func ConnectDB()
- func CountFilesEntries() int64
- func CreateFile(name string, url string, comment string, blob string) (uint, error)
- func CreateGroup(name string, email string, displayName string) error
- func CreateStore() sessions.Store
- func CreateUser(name string, passhash string, email string, displayName string) error
- func DeleteGroup(group Group) error
- func DeleteUser(user User) error
- func DeleteUserFromGroup(username string, groupname string) error
- func GetFileBlob(id uint) string
- func SetGroupDisplayName(group Group, name string) error
- func SetGroupName(group Group, name string) error
- func SetSimpleAttributes(id uint, mime string, size int64, sha256 string, sha1 string, md5 string, ...)
- func SetUserDisplayName(user User, name string) error
- func SetUserEmail(user User, email string) error
- func SetUserName(user User, name string) error
- func SetUserPassHash(user User, hash string) error
- func SetupDB()
- func UpdateOriginalName(id uint, originalName string)
- type Attachment
- type Container
- type File
- type FileProperties
- type Group
- type Pod
- type PodType
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserToGroup ¶
func ConnectDB ¶
func ConnectDB()
ConnectDB finds the correct database type and connects to it, then stores the pointer to the database handler in a variable
func CountFilesEntries ¶
func CountFilesEntries() int64
func CreateFile ¶
func CreateStore ¶
func CreateUser ¶
func DeleteGroup ¶
func DeleteUser ¶
func DeleteUserFromGroup ¶
func GetFileBlob ¶
func SetGroupDisplayName ¶
func SetGroupName ¶
func SetSimpleAttributes ¶
func SetUserDisplayName ¶
func SetUserEmail ¶
func SetUserName ¶
func SetUserPassHash ¶
func SetupDB ¶
func SetupDB()
SetupDB checks if database has already been initialized and users exist, otherwise creates default users
func UpdateOriginalName ¶
Types ¶
type Attachment ¶
type Container ¶
type Container struct { gorm.Model ContainerID string FileID uint Status int Port int User string Password string //This has to be stored somewhere in plain text... ProxyFolder string Image string }
func ContainerByFolder ¶
ContainerByFolder retrieves the Container by its folder UUID
func ContainerByID ¶
ContainerByID gets the Container by its DB ID
type File ¶
type File struct { gorm.Model Name string Comment *string StatusID uint Blob string Attachments []Attachment Properties FileProperties CreatorID uint AssigneeID uint }
func GetFileByBlob ¶
func GetFileByID ¶
type FileProperties ¶
type Group ¶
type Group struct { gorm.Model Name string `grom:"unique;index"` DisplayName string Users []User `gorm:"many2many:user_groups"` }
func GetAllGroups ¶
func GetGroupByID ¶
func GetGroupByName ¶
Click to show internal directories.
Click to hide internal directories.