Documentation ¶
Index ¶
- Variables
- type Cache
- type Collection
- type DataType
- type Database
- type Estate
- type Master
- type MediaDatabase
- func (db *MediaDatabase) CreateCollection(name string, estate *Estate, storage *Storage, ...) (*Collection, error)
- func (db *MediaDatabase) CreateEstate(name, description string) (*Estate, error)
- func (db *MediaDatabase) CreateMaster(collection *Collection, signature, urn string, parent *Master) (*Master, error)
- func (db *MediaDatabase) CreateStorage(name string, fsname, jwtKey string) (*Storage, error)
- func (db *MediaDatabase) GetCache(collection, signature, action string, paramstr string) (*Cache, error)
- func (db *MediaDatabase) GetCacheByMaster(master *Master, action string, paramstr string) (*Cache, error)
- func (db *MediaDatabase) GetCollectionById(id int64) (*Collection, error)
- func (db *MediaDatabase) GetCollectionByName(name string) (*Collection, error)
- func (db *MediaDatabase) GetEstateById(id int64) (*Estate, error)
- func (db *MediaDatabase) GetEstateByName(name string) (*Estate, error)
- func (db *MediaDatabase) GetMaster(collection *Collection, signature string) (*Master, error)
- func (db *MediaDatabase) GetMasterById(collection *Collection, masterid int64) (*Master, error)
- func (db *MediaDatabase) GetStorageById(id int64) (*Storage, error)
- func (db *MediaDatabase) GetStorageByName(name string) (*Storage, error)
- func (db *MediaDatabase) Init() error
- type PostgresDB
- func (db *PostgresDB) CreateCollection(mdb *MediaDatabase, name string, estate *Estate, storage *Storage, ...) (*Collection, error)
- func (db *PostgresDB) CreateEstate(mdb *MediaDatabase, name, description string) (*Estate, error)
- func (db *PostgresDB) CreateMaster(mdb *MediaDatabase, collection *Collection, signature, urn string, ...) (*Master, error)
- func (db *PostgresDB) CreateStorage(mdb *MediaDatabase, name string, fsname, jwtKey string) (*Storage, error)
- func (db *PostgresDB) GetCache(mdb *MediaDatabase, collection, signature, action string, paramstr string) (*Cache, error)
- func (db *PostgresDB) GetCacheByMaster(mdb *MediaDatabase, master *Master, action string, paramstr string) (*Cache, error)
- func (db *PostgresDB) GetCollectionById(mdb *MediaDatabase, CollectionId int64) (*Collection, error)
- func (db *PostgresDB) GetCollectionByName(mdb *MediaDatabase, Name string) (*Collection, error)
- func (db *PostgresDB) GetCollections(mdb *MediaDatabase, callback func(storage *Collection) error) error
- func (db *PostgresDB) GetEstateById(mdb *MediaDatabase, EstateID int64) (*Estate, error)
- func (db *PostgresDB) GetEstateByName(mdb *MediaDatabase, Name string) (*Estate, error)
- func (db *PostgresDB) GetEstates(mdb *MediaDatabase, callback func(estate *Estate) error) error
- func (db *PostgresDB) GetMaster(mdb *MediaDatabase, collection *Collection, signature string) (*Master, error)
- func (db *PostgresDB) GetMasterById(mdb *MediaDatabase, collection *Collection, masterid int64) (*Master, error)
- func (db *PostgresDB) GetStorageById(mdb *MediaDatabase, storageid int64) (*Storage, error)
- func (db *PostgresDB) GetStorageByName(mdb *MediaDatabase, name string) (*Storage, error)
- func (db *PostgresDB) GetStorages(mdb *MediaDatabase, callback func(storage *Storage) error) error
- func (db *PostgresDB) StoreCache(mdb *MediaDatabase, cache *Cache) error
- func (db *PostgresDB) StoreMaster(mdb *MediaDatabase, master *Master) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("database: could not find entry")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Id int64 `json:"id"` CollectionId int64 `json:"collectionid"` MasterId int64 `json:"masterid"` Action string `json:"action"` Params string `json:"params"` Mimetype string `json:"mimetype"` Filesize int64 `json:"filesize"` Path string `json:"path"` Width int64 `json:"width,omitempty"` Height int64 `json:"height,omitempty"` Duration int64 `json:"duration,omitempty"` // contains filtered or unexported fields }
func (*Cache) GetCollection ¶
func (c *Cache) GetCollection() (*Collection, error)
type Collection ¶
type Collection struct { Id int64 `json:"id"` EstateId int64 `json:"estateid"` StorageId int64 `json:"storageid"` Name string `json:"string"` Description string `json:"description,omitempty"` ZoteroGroup int64 `json:"zoterogroup,omitempty"` // contains filtered or unexported fields }
func NewCollection ¶
func NewCollection(mdb *MediaDatabase, id int64, storage *Storage, estate *Estate, name, description string, zoteroGroup int64) (*Collection, error)
func (*Collection) GetEstate ¶
func (coll *Collection) GetEstate() (*Estate, error)
func (*Collection) GetMasterById ¶
func (coll *Collection) GetMasterById(masterid int64) (*Master, error)
func (*Collection) GetStorage ¶
func (coll *Collection) GetStorage() (*Storage, error)
type DataType ¶
type DataType int64
const DT_Cache DataType = 5
const DT_Collection DataType = 2
const DT_Estate DataType = 3
const DT_Master DataType = 4
const DT_Storage DataType = 1
type Database ¶
type Database interface { GetStorages(mdb *MediaDatabase, callback func(storage *Storage) error) error GetStorageById(mdb *MediaDatabase, storageid int64) (*Storage, error) GetStorageByName(mdb *MediaDatabase, name string) (*Storage, error) CreateStorage(mdb *MediaDatabase, name string, fsname, jwtKey string) (*Storage, error) GetEstates(mdb *MediaDatabase, callback func(estate *Estate) error) error GetEstateById(mdb *MediaDatabase, EstateID int64) (*Estate, error) GetEstateByName(mdb *MediaDatabase, Name string) (*Estate, error) CreateEstate(mdb *MediaDatabase, name, description string) (*Estate, error) GetCollections(mdb *MediaDatabase, callback func(storage *Collection) error) error GetCollectionById(mdb *MediaDatabase, CollectionId int64) (*Collection, error) GetCollectionByName(mdb *MediaDatabase, Name string) (*Collection, error) CreateCollection(db *MediaDatabase, name string, estate *Estate, storage *Storage, signature_prefix, description string, zoterogroup int64) (*Collection, error) GetMaster(mdb *MediaDatabase, collection *Collection, signature string) (*Master, error) GetMasterById(mdb *MediaDatabase, collection *Collection, masterid int64) (*Master, error) CreateMaster(mdb *MediaDatabase, collection *Collection, signature, urn string, parent *Master) (*Master, error) StoreMaster(db *MediaDatabase, m *Master) error GetCacheByMaster(mdb *MediaDatabase, master *Master, action string, paramstr string) (*Cache, error) GetCache(mdb *MediaDatabase, collection, signature, action string, paramstr string) (*Cache, error) StoreCache(mdb *MediaDatabase, cache *Cache) error }
type Estate ¶
type Master ¶
type Master struct { Id int64 `json:"id"` ParentId int64 `json:"parentid,omitempty"` Signature string `json:"signature"` CollectionId int64 `json:"collectionid"` Urn string `json:"urn"` Type string `json:"type,omitempty"` Subtype string `json:"subtype,omitempty"` Status string `json:"status,omitempty"` Mimetype string `json:"mimetype,omitempty"` Objecttype string `json:"objecttype,omitempty"` Sha256 string `json:"sha256"` Metadata interface{} `json:"metadata,omitempty"` Error string `json:"error,omitempty"` // contains filtered or unexported fields }
func NewMaster ¶
func NewMaster(mdb *MediaDatabase, coll *Collection, id, parentid int64, signature, urn, status, _type, subtype, mimetype, error, objecttype, sha256 string, metadata interface{}) (*Master, error)
func (*Master) GetCollection ¶
func (m *Master) GetCollection() (*Collection, error)
type MediaDatabase ¶
type MediaDatabase struct {
// contains filtered or unexported fields
}
func NewMediaDatabase ¶
func NewMediaDatabase(db Database, fss ...filesystem.FileSystem) (*MediaDatabase, error)
func (*MediaDatabase) CreateCollection ¶
func (db *MediaDatabase) CreateCollection(name string, estate *Estate, storage *Storage, signature_prefix, description string, zoterogroup int64) (*Collection, error)
func (*MediaDatabase) CreateEstate ¶
func (db *MediaDatabase) CreateEstate(name, description string) (*Estate, error)
func (*MediaDatabase) CreateMaster ¶
func (db *MediaDatabase) CreateMaster(collection *Collection, signature, urn string, parent *Master) (*Master, error)
func (*MediaDatabase) CreateStorage ¶
func (db *MediaDatabase) CreateStorage(name string, fsname, jwtKey string) (*Storage, error)
func (*MediaDatabase) GetCache ¶
func (db *MediaDatabase) GetCache(collection, signature, action string, paramstr string) (*Cache, error)
func (*MediaDatabase) GetCacheByMaster ¶
func (*MediaDatabase) GetCollectionById ¶
func (db *MediaDatabase) GetCollectionById(id int64) (*Collection, error)
func (*MediaDatabase) GetCollectionByName ¶
func (db *MediaDatabase) GetCollectionByName(name string) (*Collection, error)
func (*MediaDatabase) GetEstateById ¶
func (db *MediaDatabase) GetEstateById(id int64) (*Estate, error)
func (*MediaDatabase) GetEstateByName ¶
func (db *MediaDatabase) GetEstateByName(name string) (*Estate, error)
func (*MediaDatabase) GetMaster ¶
func (db *MediaDatabase) GetMaster(collection *Collection, signature string) (*Master, error)
func (*MediaDatabase) GetMasterById ¶
func (db *MediaDatabase) GetMasterById(collection *Collection, masterid int64) (*Master, error)
func (*MediaDatabase) GetStorageById ¶
func (db *MediaDatabase) GetStorageById(id int64) (*Storage, error)
func (*MediaDatabase) GetStorageByName ¶
func (db *MediaDatabase) GetStorageByName(name string) (*Storage, error)
func (*MediaDatabase) Init ¶
func (db *MediaDatabase) Init() error
type PostgresDB ¶
type PostgresDB struct {
// contains filtered or unexported fields
}
func NewPostgresDB ¶
func NewPostgresDB(db *sql.DB, schema string, logger *logging.Logger) (*PostgresDB, error)
func (*PostgresDB) CreateCollection ¶
func (db *PostgresDB) CreateCollection(mdb *MediaDatabase, name string, estate *Estate, storage *Storage, signaturePrefix, description string, zoteroGroup int64) (*Collection, error)
func (*PostgresDB) CreateEstate ¶
func (db *PostgresDB) CreateEstate(mdb *MediaDatabase, name, description string) (*Estate, error)
func (*PostgresDB) CreateMaster ¶
func (db *PostgresDB) CreateMaster(mdb *MediaDatabase, collection *Collection, signature, urn string, parent *Master) (*Master, error)
func (*PostgresDB) CreateStorage ¶
func (db *PostgresDB) CreateStorage(mdb *MediaDatabase, name string, fsname, jwtKey string) (*Storage, error)
func (*PostgresDB) GetCache ¶
func (db *PostgresDB) GetCache(mdb *MediaDatabase, collection, signature, action string, paramstr string) (*Cache, error)
func (*PostgresDB) GetCacheByMaster ¶
func (db *PostgresDB) GetCacheByMaster(mdb *MediaDatabase, master *Master, action string, paramstr string) (*Cache, error)
func (*PostgresDB) GetCollectionById ¶
func (db *PostgresDB) GetCollectionById(mdb *MediaDatabase, CollectionId int64) (*Collection, error)
func (*PostgresDB) GetCollectionByName ¶
func (db *PostgresDB) GetCollectionByName(mdb *MediaDatabase, Name string) (*Collection, error)
func (*PostgresDB) GetCollections ¶
func (db *PostgresDB) GetCollections(mdb *MediaDatabase, callback func(storage *Collection) error) error
func (*PostgresDB) GetEstateById ¶
func (db *PostgresDB) GetEstateById(mdb *MediaDatabase, EstateID int64) (*Estate, error)
func (*PostgresDB) GetEstateByName ¶
func (db *PostgresDB) GetEstateByName(mdb *MediaDatabase, Name string) (*Estate, error)
func (*PostgresDB) GetEstates ¶
func (db *PostgresDB) GetEstates(mdb *MediaDatabase, callback func(estate *Estate) error) error
func (*PostgresDB) GetMaster ¶
func (db *PostgresDB) GetMaster(mdb *MediaDatabase, collection *Collection, signature string) (*Master, error)
func (*PostgresDB) GetMasterById ¶
func (db *PostgresDB) GetMasterById(mdb *MediaDatabase, collection *Collection, masterid int64) (*Master, error)
func (*PostgresDB) GetStorageById ¶
func (db *PostgresDB) GetStorageById(mdb *MediaDatabase, storageid int64) (*Storage, error)
func (*PostgresDB) GetStorageByName ¶
func (db *PostgresDB) GetStorageByName(mdb *MediaDatabase, name string) (*Storage, error)
func (*PostgresDB) GetStorages ¶
func (db *PostgresDB) GetStorages(mdb *MediaDatabase, callback func(storage *Storage) error) error
func (*PostgresDB) StoreCache ¶
func (db *PostgresDB) StoreCache(mdb *MediaDatabase, cache *Cache) error
func (*PostgresDB) StoreMaster ¶
func (db *PostgresDB) StoreMaster(mdb *MediaDatabase, master *Master) error
type Storage ¶
type Storage struct { Fs filesystem.FileSystem `json:"-"` FSType string `json:"fstype"` Id int64 `json:"id"` Name string `json:"name"` Filebase string `json:"filebase"` DataDir string `json:"data"` VideoDir string `json:"video"` SubmasterDir string `json:"submasterdir"` TempDir string `json:"temp"` JWTKey string `json:"jwtkey"` // contains filtered or unexported fields }
func NewStorage ¶
func NewStorage(mdb *MediaDatabase, id int64, name, filebase, datadir, videodir, submasterdir, tempdir, jwtkey string) (*Storage, error)
Click to show internal directories.
Click to hide internal directories.