Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Copy(ctx context.Context, storage interface{}, sourcePath, targetPath string) (int, error)
- func (c *Cache) CreateStorage(ctx context.Context, id string) (int, error)
- func (c *Cache) Delete(ctx context.Context, storage interface{}, user, path, trashPath string) error
- func (c *Cache) DeleteRecycleItem(ctx context.Context, user, path string, timestamp int) error
- func (c *Cache) EmptyRecycle(ctx context.Context, user string) error
- func (c *Cache) Get(ctx context.Context, s interface{}, p string) (*File, error)
- func (c *Cache) GetNumericStorageID(ctx context.Context, id string) (int, error)
- func (c *Cache) GetRecycleItem(ctx context.Context, user, path string, timestamp int) (*TrashItem, error)
- func (c *Cache) GetStorage(ctx context.Context, numeridID interface{}) (*Storage, error)
- func (c *Cache) GetStorageOwner(ctx context.Context, numericID interface{}) (string, error)
- func (c *Cache) GetStorageOwnerByFileID(ctx context.Context, numericID interface{}) (string, error)
- func (c *Cache) InsertOrUpdate(ctx context.Context, storage interface{}, data map[string]interface{}, ...) (int, error)
- func (c *Cache) List(ctx context.Context, storage interface{}, p string) ([]*File, error)
- func (c *Cache) ListStorages(ctx context.Context, onlyHome bool) ([]*Storage, error)
- func (c *Cache) Move(ctx context.Context, storage interface{}, sourcePath, targetPath string) error
- func (c *Cache) Path(ctx context.Context, id interface{}) (string, error)
- func (c *Cache) Permissions(ctx context.Context, storage interface{}, p string) (*provider.ResourcePermissions, error)
- func (c *Cache) Purge(ctx context.Context, storage interface{}, path string) error
- func (c *Cache) PurgeRecycleItem(ctx context.Context, user, path string, timestamp int, isVersionFile bool) error
- func (c *Cache) SetEtag(ctx context.Context, storage interface{}, path, etag string) error
- type File
- type Scannable
- type Storage
- type TrashItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache represents a oc10-style file cache
func (*Cache) Copy ¶
func (c *Cache) Copy(ctx context.Context, storage interface{}, sourcePath, targetPath string) (int, error)
Copy creates a copy of the specified entry at the target path
func (*Cache) CreateStorage ¶
CreateStorage creates a new storage and returns its numeric id
func (*Cache) Delete ¶
func (c *Cache) Delete(ctx context.Context, storage interface{}, user, path, trashPath string) error
Delete removes the specified storage/path from the cache
func (*Cache) DeleteRecycleItem ¶
DeleteRecycleItem deletes the specified item from the trash
func (*Cache) EmptyRecycle ¶
EmptyRecycle clears the recycle bin for the given user
func (*Cache) GetNumericStorageID ¶
GetNumericStorageID returns the database id for the given storage
func (*Cache) GetRecycleItem ¶
func (c *Cache) GetRecycleItem(ctx context.Context, user, path string, timestamp int) (*TrashItem, error)
GetRecycleItem returns the specified recycle item
func (*Cache) GetStorage ¶
GetStorage returns the storage with the given numeric id
func (*Cache) GetStorageOwner ¶
GetStorageOwner returns the username of the owner of the given storage
func (*Cache) GetStorageOwnerByFileID ¶
GetStorageOwnerByFileID returns the username of the owner of the given entry
func (*Cache) InsertOrUpdate ¶
func (c *Cache) InsertOrUpdate(ctx context.Context, storage interface{}, data map[string]interface{}, allowEmptyParent bool) (int, error)
InsertOrUpdate creates or updates a cache entry
func (*Cache) ListStorages ¶
ListStorages returns the list of numeric ids of all storages Optionally only home storages are considered
func (*Cache) Permissions ¶
func (c *Cache) Permissions(ctx context.Context, storage interface{}, p string) (*provider.ResourcePermissions, error)
Permissions returns the permissions for the specified storage/path
func (*Cache) Purge ¶
Purge removes the specified storage/path from the cache without putting it into the trash
type File ¶
type File struct { ID int Storage int Parent int MimePart int MimeType int MimeTypeString string Size int MTime int StorageMTime int UnencryptedSize int Permissions int Encrypted bool Path string Name string Etag string Checksum string }
File represents an entry of the file cache
type Scannable ¶
type Scannable interface {
Scan(...interface{}) error
}
Scannable describes the interface providing a Scan method