Documentation ¶
Index ¶
- Constants
- Variables
- func SignURLParams(parts []string, key []byte) (string, error)
- func VerifyURLParams(parts []string, exp, signature string, key []byte) error
- type App
- type FileSystemStorage
- func (fs *FileSystemStorage) CreateBlobDocument(uid, filename, parent string, stream io.Reader) (doc *storage.Document, err error)
- func (fs *FileSystemStorage) CreateDocument(uid, filename, parent string, stream io.Reader) (doc *storage.Document, err error)
- func (fs *FileSystemStorage) Export(uid, docid string) (r io.ReadCloser, err error)
- func (fs *FileSystemStorage) ExportDocument(uid, id, outputType string, exportOption storage.ExportOption) (io.ReadCloser, error)
- func (fs *FileSystemStorage) GetAllMetadata(uid string) (result []*messages.RawMetadata, err error)
- func (fs *FileSystemStorage) GetBlobURL(uid, blobid, scope string) (docurl string, exp time.Time, err error)
- func (fs *FileSystemStorage) GetDocument(uid, id string) (io.ReadCloser, error)
- func (fs *FileSystemStorage) GetMetadata(uid, id string) (*messages.RawMetadata, error)
- func (fs *FileSystemStorage) GetStorageURL(uid, id string) (docurl string, expiration time.Time, err error)
- func (fs *FileSystemStorage) GetTree(uid string) (t *models.HashTree, err error)
- func (fs *FileSystemStorage) GetUser(uid string) (user *model.User, err error)
- func (fs *FileSystemStorage) GetUsers() (users []*model.User, err error)
- func (fs *FileSystemStorage) LoadBlob(uid, blobid string) (reader io.ReadCloser, gen int64, size int64, err error)
- func (fs *FileSystemStorage) RegisterUser(u *model.User) (err error)
- func (fs *FileSystemStorage) RemoveDocument(uid, id string) error
- func (fs *FileSystemStorage) RemoveUser(uid string) (err error)
- func (fs *FileSystemStorage) SaveTree(uid string, t *models.HashTree) error
- func (fs *FileSystemStorage) StoreBlob(uid, id string, stream io.Reader, lastGen int64) (generation int64, err error)
- func (fs *FileSystemStorage) StoreDocument(uid, id string, stream io.ReadCloser) error
- func (fs *FileSystemStorage) UpdateMetadata(uid string, r *messages.RawMetadata) error
- func (fs *FileSystemStorage) UpdateUser(u *model.User) (err error)
- type LocalBlobStorage
- type StorageClaim
Constants ¶
const ( DefaultTrashDir = ".trash" CacheDir = ".cache" Archive = "archive" SyncFolder = "sync" )
DefaultTrashDir name of the trash dir
Variables ¶
var ErrorNotFound = errors.New("not found")
ErrorNotFound not found
var ErrorWrongGeneration = errors.New("wrong generation")
ErrorWrongGeneration the geration did not match
Functions ¶
func SignURLParams ¶ added in v0.0.5
SignURLParams signs url params
Types ¶
type App ¶ added in v0.0.5
type App struct {
// contains filtered or unexported fields
}
App file system document storage
func NewApp ¶ added in v0.0.5
func NewApp(cfg *config.Config, fs *FileSystemStorage) *App
NewApp StorageApp various storage routes
func (*App) RegisterRoutes ¶ added in v0.0.5
RegisterRoutes blah
type FileSystemStorage ¶ added in v0.0.5
FileSystemStorage store everything to disk
func NewStorage ¶ added in v0.0.4
func NewStorage(cfg *config.Config) *FileSystemStorage
NewStorage new file system storage
func (*FileSystemStorage) CreateBlobDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) CreateBlobDocument(uid, filename, parent string, stream io.Reader) (doc *storage.Document, err error)
CreateBlobDocument creates a new document
func (*FileSystemStorage) CreateDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) CreateDocument(uid, filename, parent string, stream io.Reader) (doc *storage.Document, err error)
CreateDocument creates a new document
func (*FileSystemStorage) Export ¶ added in v0.0.5
func (fs *FileSystemStorage) Export(uid, docid string) (r io.ReadCloser, err error)
Export exports a document
func (*FileSystemStorage) ExportDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) ExportDocument(uid, id, outputType string, exportOption storage.ExportOption) (io.ReadCloser, error)
ExportDocument Exports a document to the outputType
func (*FileSystemStorage) GetAllMetadata ¶ added in v0.0.5
func (fs *FileSystemStorage) GetAllMetadata(uid string) (result []*messages.RawMetadata, err error)
GetAllMetadata load all metadata
func (*FileSystemStorage) GetBlobURL ¶ added in v0.0.5
func (fs *FileSystemStorage) GetBlobURL(uid, blobid, scope string) (docurl string, exp time.Time, err error)
GetBlobURL return a url for a file to store
func (*FileSystemStorage) GetDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) GetDocument(uid, id string) (io.ReadCloser, error)
GetDocument Opens a document by id
func (*FileSystemStorage) GetMetadata ¶ added in v0.0.5
func (fs *FileSystemStorage) GetMetadata(uid, id string) (*messages.RawMetadata, error)
GetMetadata loads a document's metadata
func (*FileSystemStorage) GetStorageURL ¶ added in v0.0.5
func (fs *FileSystemStorage) GetStorageURL(uid, id string) (docurl string, expiration time.Time, err error)
GetStorageURL the storage url
func (*FileSystemStorage) GetTree ¶ added in v0.0.5
func (fs *FileSystemStorage) GetTree(uid string) (t *models.HashTree, err error)
GetTree returns the cached blob tree for the user
func (*FileSystemStorage) GetUser ¶ added in v0.0.5
func (fs *FileSystemStorage) GetUser(uid string) (user *model.User, err error)
GetUser retrieves a user from the storage
func (*FileSystemStorage) GetUsers ¶ added in v0.0.5
func (fs *FileSystemStorage) GetUsers() (users []*model.User, err error)
GetUsers gets all users
func (*FileSystemStorage) LoadBlob ¶ added in v0.0.5
func (fs *FileSystemStorage) LoadBlob(uid, blobid string) (reader io.ReadCloser, gen int64, size int64, err error)
LoadBlob Opens a blob by id
func (*FileSystemStorage) RegisterUser ¶ added in v0.0.5
func (fs *FileSystemStorage) RegisterUser(u *model.User) (err error)
RegisterUser blah
func (*FileSystemStorage) RemoveDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) RemoveDocument(uid, id string) error
RemoveDocument removes document (moves it to trash)
func (*FileSystemStorage) RemoveUser ¶ added in v0.0.8
func (fs *FileSystemStorage) RemoveUser(uid string) (err error)
RemoveUser remove the user and their data
func (*FileSystemStorage) SaveTree ¶ added in v0.0.5
func (fs *FileSystemStorage) SaveTree(uid string, t *models.HashTree) error
SaveTree saves the cached tree
func (*FileSystemStorage) StoreBlob ¶ added in v0.0.5
func (fs *FileSystemStorage) StoreBlob(uid, id string, stream io.Reader, lastGen int64) (generation int64, err error)
StoreBlob stores a document
func (*FileSystemStorage) StoreDocument ¶ added in v0.0.5
func (fs *FileSystemStorage) StoreDocument(uid, id string, stream io.ReadCloser) error
StoreDocument stores a document
func (*FileSystemStorage) UpdateMetadata ¶ added in v0.0.5
func (fs *FileSystemStorage) UpdateMetadata(uid string, r *messages.RawMetadata) error
UpdateMetadata updates the metadata of a document
func (*FileSystemStorage) UpdateUser ¶ added in v0.0.5
func (fs *FileSystemStorage) UpdateUser(u *model.User) (err error)
UpdateUser updates the user
type LocalBlobStorage ¶ added in v0.0.5
type LocalBlobStorage struct {
// contains filtered or unexported fields
}
LocalBlobStorage local file system storage
func (*LocalBlobStorage) GetReader ¶ added in v0.0.5
func (p *LocalBlobStorage) GetReader(hash string) (io.ReadCloser, error)
GetReader reader for a given hash
func (*LocalBlobStorage) GetRootIndex ¶ added in v0.0.5
func (p *LocalBlobStorage) GetRootIndex() (string, int64, error)
GetRootIndex the hash of the root index
func (*LocalBlobStorage) Write ¶ added in v0.0.5
func (p *LocalBlobStorage) Write(hash string, r io.Reader) error
Write stores the reader in the hash
func (*LocalBlobStorage) WriteRootIndex ¶ added in v0.0.5
func (p *LocalBlobStorage) WriteRootIndex(generation int64, roothash string) (int64, error)
WriteRootIndex writes the root index
type StorageClaim ¶ added in v0.0.5
type StorageClaim struct { DocumentID string `json:"documentId"` UserID string `json:"userId"` jwt.StandardClaims }
StorageClaim used for file retrieval