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.
50 lines
1.4 KiB
Go
50 lines
1.4 KiB
Go
package sriracha
|
|
|
|
// ExtensionDatabase defines the interface for extensions that handle storing and
|
|
// retrieving information within a database.
|
|
type ExtensionDatabase interface {
|
|
Extension
|
|
|
|
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
|
|
}
|