You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/database/database.go

51 lines
1.0 KiB
Go

package database
type DBMigrate interface {
Migrate(migrationDir string) error
}
type DBQueryAppunti interface {
AllDispensaFile() ([]DispensaFile, error)
}
type DBDispense interface {
Create(template Dispensa) (string, error)
Get(id string) (Dispensa, error)
All() ([]Dispensa, error)
Update(d Dispensa) error
Delete(id string) error
}
type DBUploads interface {
Create(template Upload) (string, error)
Get(id string) (Upload, error)
}
type DBFileApprovals interface {
Create(template FileApproval) (string, error)
Get(id string) (FileApproval, error)
All() ([]FileApproval, error)
Update(d FileApproval) error
Delete(id string) error
}
type DBDispensaTags interface {
Set(dispensaId string, tags []string) error
Get(dispensaId string) ([]string, error)
}
type DBDownloads interface {
Create(template Download) error
}
type DB struct {
DBMigrate
DBQueryAppunti
Dispense DBDispense
Uploads DBUploads
FileApprovals DBFileApprovals
DispensaTags DBDispensaTags
Downloads DBDownloads
}