mirror of
https://github.com/1f349/dendrite.git
synced 2024-12-23 08:44:11 +00:00
mediaapi/storage: Simplify descriptions
This commit is contained in:
parent
9678cb6ea1
commit
4f2d9a3b69
@ -23,13 +23,13 @@ import (
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
// A Database is used to store metadata about a repository of media files.
|
||||
// Database is used to store metadata about a repository of media files.
|
||||
type Database struct {
|
||||
statements statements
|
||||
db *sql.DB
|
||||
}
|
||||
|
||||
// Open a postgres database.
|
||||
// Open opens a postgres database.
|
||||
func Open(dataSourceName string) (*Database, error) {
|
||||
var d Database
|
||||
var err error
|
||||
@ -48,8 +48,8 @@ func (d *Database) StoreMediaMetadata(mediaMetadata *types.MediaMetadata) error
|
||||
return d.statements.insertMedia(mediaMetadata)
|
||||
}
|
||||
|
||||
// GetMediaMetadata returns metadata about media stored on this server. The media could
|
||||
// have been uploaded to this server or fetched from another server and cached here.
|
||||
// GetMediaMetadata returns metadata about media stored on this server.
|
||||
// The media could have been uploaded to this server or fetched from another server and cached here.
|
||||
// Returns sql.ErrNoRows if there is no metadata associated with this media.
|
||||
func (d *Database) GetMediaMetadata(mediaID types.MediaID, mediaOrigin gomatrixserverlib.ServerName) (*types.MediaMetadata, error) {
|
||||
return d.statements.selectMedia(mediaID, mediaOrigin)
|
||||
|
Loading…
Reference in New Issue
Block a user