fs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTrashDir = ".trash"
	CacheDir        = ".cache"
	Archive         = "archive"
)

DefaultTrashDir name of the trash dir

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Cfg *config.Config
}

Storage file system document storage

func NewStorage added in v0.0.4

func NewStorage(cfg *config.Config) *Storage

NewStorage create a new instance

func (*Storage) CreateDocument added in v0.0.4

func (fs *Storage) CreateDocument(uid, filename string, stream io.ReadCloser) (doc *messages.RawDocument, err error)

CreateDocument creates a new document

func (*Storage) ExportDocument added in v0.0.4

func (fs *Storage) ExportDocument(uid, id, outputType string, exportOption storage.ExportOption) (io.ReadCloser, error)

ExportDocument Exports a document to the outputType

func (*Storage) GetAllMetadata

func (fs *Storage) GetAllMetadata(uid string) (result []*messages.RawDocument, err error)

GetAllMetadata load all metadata

func (*Storage) GetDocument

func (fs *Storage) GetDocument(uid, id string) (io.ReadCloser, error)

GetDocument Opens a document by id

func (*Storage) GetMetadata

func (fs *Storage) GetMetadata(uid, id string) (*messages.RawDocument, error)

GetMetadata loads a document's metadata

func (*Storage) GetStorageURL

func (fs *Storage) GetStorageURL(uid string, id string) (docurl string, expiration time.Time, err error)

GetStorageURL return a url for a file to store

func (*Storage) GetUser added in v0.0.4

func (fs *Storage) GetUser(uid string) (user *model.User, err error)

GetUser retrieves a user from the storage

func (*Storage) GetUsers added in v0.0.4

func (fs *Storage) GetUsers() (users []*model.User, err error)

GetUsers gets all users

func (*Storage) RegisterRoutes

func (fs *Storage) RegisterRoutes(router *gin.Engine)

RegisterRoutes blah

func (*Storage) RegisterUser added in v0.0.4

func (fs *Storage) RegisterUser(u *model.User) (err error)

RegisterUser blah

func (*Storage) RemoveDocument

func (fs *Storage) RemoveDocument(uid, id string) error

RemoveDocument removes document (moves it to trash)

func (*Storage) StoreDocument

func (fs *Storage) StoreDocument(uid, id string, stream io.ReadCloser) error

StoreDocument stores a document

func (*Storage) UpdateMetadata

func (fs *Storage) UpdateMetadata(uid string, r *messages.RawDocument) error

UpdateMetadata updates the metadata of a document

func (*Storage) UpdateUser added in v0.0.4

func (fs *Storage) UpdateUser(u *model.User) (err error)

UpdateUser updates the user

Jump to

Keyboard shortcuts

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