files

package
v0.0.0-...-78f5e88 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const UrlSeparator string = "/"

Variables

This section is empty.

Functions

func AppendFile

func AppendFile(db *sql.DB, fi DbFileInfo, folderId int64)

func AppendFolder

func AppendFolder(db *sql.DB, fi DbFileInfo, parentId int64) int64

func CheckDatabase

func CheckDatabase()

func ClearUserStorage

func ClearUserStorage(userId int)

func GetDbConnection

func GetDbConnection() *sql.DB

func RemoveFile

func RemoveFile(fileId int64)

func RemoveFolder

func RemoveFolder(folderId int64)

func ShareFolderToUser

func ShareFolderToUser(folderId int64, userId int, readOnly bool)

Types

type DbFileInfo

type DbFileInfo struct {
	Id              int64
	IsDir           bool
	IsShared        bool
	IsReadOnly      bool
	Name            string
	Path            string
	ETag            string
	Mime            string
	Size            int64
	CreatedDateUtc  time.Time
	ModifiedDateUtc time.Time
	OwnerId         int
}

func FindSharedRootFolder

func FindSharedRootFolder(url string, userId int) (item DbFileInfo, found bool)

func GetFileInfo

func GetFileInfo(url string, userId int, urlPrefix string) (file DbFileInfo, hasAccess bool)

func GetFolderContent

func GetFolderContent(url string, userId int, urlPrefix string, includeContent bool) (items []DbFileInfo, found bool)

func GetFolderInfo

func GetFolderInfo(url string, userId int) (item *DbFileInfo, found bool)

func GetFolderInfoById

func GetFolderInfoById(folderId int64) (item *DbFileInfo, found bool)

type DbHierarchyItem

type DbHierarchyItem struct {
	Id       int64
	IsDir    bool
	Name     string
	OwnerId  int
	ParentId *int64
	Child    *DbHierarchyItem
}

func GetFileHierarchy

func GetFileHierarchy(fileId int64) (root DbHierarchyItem, found bool)

Jump to

Keyboard shortcuts

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