filecache

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 New

func New(driver string, sqldb *sql.DB) (*Cache, error)

New returns a new Cache instance connecting to the given sql.DB

func NewMysql

func NewMysql(dsn string) (*Cache, error)

NewMysql returns a new Cache instance connecting to a MySQL database

func (*Cache) Copy

func (c *Cache) Copy(storage interface{}, sourcePath, targetPath string) (int, error)

Copy creates a copy of the specified entry at the target path

func (*Cache) Delete

func (c *Cache) Delete(storage interface{}, user, path, trashPath string) error

Delete removes the specified storage/path from the cache

func (*Cache) Get

func (c *Cache) Get(s interface{}, p string) (*File, error)

Get returns the cache entry for the specified storage/path

func (*Cache) GetNumericStorageID

func (c *Cache) GetNumericStorageID(id string) (int, error)

GetNumericStorageID returns the database id for the given storage

func (*Cache) GetRecycleItem

func (c *Cache) GetRecycleItem(user, path string, timestamp int) (*TrashItem, error)

GetRecycleItem returns the specified recycle item

func (*Cache) InsertMimetype added in v1.8.0

func (c *Cache) InsertMimetype(mimetype string) error

InsertMimetype adds a new mimetype to the database

func (*Cache) InsertOrUpdate

func (c *Cache) InsertOrUpdate(storage interface{}, data map[string]interface{}) (int, error)

InsertOrUpdate creates or updates a cache entry

func (*Cache) Move

func (c *Cache) Move(storage interface{}, sourcePath, targetPath string) error

Move moves the specified entry to the target path

func (*Cache) Path

func (c *Cache) Path(id interface{}) (string, error)

Path returns the path for the specified entry

func (*Cache) Permissions

func (c *Cache) Permissions(storage interface{}, p string) (*provider.ResourcePermissions, error)

Permissions returns the permissions for the specified storage/path

func (*Cache) PurgeRecycleItem

func (c *Cache) PurgeRecycleItem(user, path string, timestamp int) error

PurgeRecycleItem deletes the specified item from the cache

func (*Cache) SetEtag

func (c *Cache) SetEtag(storage interface{}, path, etag string) error

SetEtag set a new etag for the specified item

type File

type File struct {
	ID              int
	Storage         int
	Parent          int
	MimePart        int
	MimeType        int
	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

type TrashItem

type TrashItem struct {
	ID        int
	Name      string
	User      string
	Path      string
	Timestamp int
}

TrashItem represents a trash item of the file cache

Jump to

Keyboard shortcuts

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