50 lines
1.4 KiB
Raw Permalink Normal View History

2023-04-21 03:03:02 +00:00
package sriracha
2023-04-30 03:17:56 +00:00
// ExtensionDatabase defines the interface for extensions that handle storing and
// retrieving information within a database.
2023-04-21 03:03:02 +00:00
type ExtensionDatabase interface {
CreateAccount(account *Account) error
AccountByID(id int) (*Account, error)
AccountByName(name string) (*Account, error)
Accounts() ([]*Account, error)
UpdateAccount(account *Account) error
DeleteAccount(account *Account) error
CreateBan(Ban *Ban) error
BanByID(id int) (*Ban, error)
BanByName(name string) (*Ban, error)
Bans() ([]*Ban, error)
UpdateBan(Ban *Ban) error
DeleteBan(Ban *Ban) error
CreateKeyword(Keyword *Keyword) error
KeywordByID(id int) (*Keyword, error)
KeywordByName(name string) (*Keyword, error)
Keywords() ([]*Keyword, error)
UpdateKeyword(Keyword *Keyword) error
DeleteKeyword(Keyword *Keyword) error
CreateLog(Log *Log) error
LogByID(id int) (*Log, error)
LogByName(name string) (*Log, error)
Logs() ([]*Log, error)
UpdateLog(Log *Log) error
DeleteLog(Log *Log) error
CreatePost(Post *Post) error
PostByID(id int) (*Post, error)
PostByName(name string) (*Post, error)
Posts() ([]*Post, error)
UpdatePost(Post *Post) error
DeletePost(Post *Post) error
CreateReport(Report *Report) error
ReportByID(id int) (*Report, error)
ReportByName(name string) (*Report, error)
Reports() ([]*Report, error)
UpdateReport(Report *Report) error
DeleteReport(Report *Report) error