file

package
v0.0.0-...-d08a43c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDbExists

func EnsureDbExists(dbfile string)

Types

type File

type File struct {
	gorm.Model
	ID   uint `gorm:"primaryKey"`
	Path string
	Tags []Tag `gorm:"foreignKey:FileRefer"`
}

type FileHandler

type FileHandler struct {
	// contains filtered or unexported fields
}

func CreateFileHandler

func CreateFileHandler(dbfile string) FileHandler

func (*FileHandler) DeleteFile

func (this *FileHandler) DeleteFile(w http.ResponseWriter, r *http.Request)

func (*FileHandler) DeleteFileTag

func (this *FileHandler) DeleteFileTag(w http.ResponseWriter, r *http.Request)

func (*FileHandler) GetFile

func (this *FileHandler) GetFile(w http.ResponseWriter, r *http.Request)

func (*FileHandler) GetFileTag

func (this *FileHandler) GetFileTag(w http.ResponseWriter, r *http.Request)

func (*FileHandler) GetFileTagsList

func (this *FileHandler) GetFileTagsList(w http.ResponseWriter, r *http.Request)

func (*FileHandler) GetFilesList

func (this *FileHandler) GetFilesList(w http.ResponseWriter, r *http.Request)

func (*FileHandler) PostFileTag

func (this *FileHandler) PostFileTag(w http.ResponseWriter, r *http.Request)

func (*FileHandler) PostFiles

func (this *FileHandler) PostFiles(w http.ResponseWriter, r *http.Request)

func (*FileHandler) PutFilePath

func (this *FileHandler) PutFilePath(w http.ResponseWriter, r *http.Request)

func (*FileHandler) PutFileTagValue

func (this *FileHandler) PutFileTagValue(w http.ResponseWriter, r *http.Request)

type FilePersistenceService

type FilePersistenceService struct {
	// contains filtered or unexported fields
}

func CreateFilePersistenceService

func CreateFilePersistenceService(dbfile string) FilePersistenceService

func (*FilePersistenceService) AddFile

func (this *FilePersistenceService) AddFile(file File)

func (*FilePersistenceService) AddTag

func (this *FilePersistenceService) AddTag(fileId int, tagName, tagValue string)

func (*FilePersistenceService) DeleteFile

func (this *FilePersistenceService) DeleteFile(fileId int)

func (*FilePersistenceService) DeleteTag

func (this *FilePersistenceService) DeleteTag(fileId int, tagName string)

func (*FilePersistenceService) FindAll

func (this *FilePersistenceService) FindAll() []File

func (*FilePersistenceService) FindByPath

func (this *FilePersistenceService) FindByPath(filePath string) []File

func (*FilePersistenceService) FindByTagName

func (this *FilePersistenceService) FindByTagName(tagName string) []File

func (*FilePersistenceService) FindByTagValue

func (this *FilePersistenceService) FindByTagValue(tagName, tagValue string) []File

func (*FilePersistenceService) GetFile

func (this *FilePersistenceService) GetFile(fileId int) File

func (*FilePersistenceService) GetTag

func (this *FilePersistenceService) GetTag(fileId int, tagName string) Tag

func (*FilePersistenceService) UpdatePath

func (this *FilePersistenceService) UpdatePath(fileId int, filePath string)

func (*FilePersistenceService) UpdateTag

func (this *FilePersistenceService) UpdateTag(fileId int, tagName, tagValue string)

type Tag

type Tag struct {
	gorm.Model
	Name      string
	Value     string
	FileRefer uint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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