quintodrome/model/library.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
431 B
Go
Raw Normal View History

2024-05-07 07:28:44 -08:00
package model
import (
"io/fs"
"os"
2024-05-07 07:29:45 -08:00
"time"
2024-05-07 07:28:44 -08:00
)
type Library struct {
2024-05-07 07:29:45 -08:00
ID int
Name string
Path string
RemotePath string
LastScanAt time.Time
UpdatedAt time.Time
CreatedAt time.Time
2024-05-07 07:28:44 -08:00
}
func (f Library) FS() fs.FS {
return os.DirFS(f.Path)
}
type Libraries []Library
type LibraryRepository interface {
2024-05-07 07:29:45 -08:00
Get(id int) (*Library, error)
Put(*Library) error
GetAll(...QueryOptions) (Libraries, error)
2024-05-07 07:28:44 -08:00
}