...

Source file src/code.rocketnine.space/tslocum/sriracha/extension_database.go

Documentation: code.rocketnine.space/tslocum/sriracha

     1  package sriracha
     2  
     3  // ExtensionDatabase defines the interface for extensions that handle storing and
     4  // retrieving information within a database.
     5  type ExtensionDatabase interface {
     6  	Extension
     7  
     8  	CreateAccount(account *Account) error
     9  	AccountByID(id int) (*Account, error)
    10  	AccountByName(name string) (*Account, error)
    11  	Accounts() ([]*Account, error)
    12  	UpdateAccount(account *Account) error
    13  	DeleteAccount(account *Account) error
    14  
    15  	CreateBan(Ban *Ban) error
    16  	BanByID(id int) (*Ban, error)
    17  	BanByName(name string) (*Ban, error)
    18  	Bans() ([]*Ban, error)
    19  	UpdateBan(Ban *Ban) error
    20  	DeleteBan(Ban *Ban) error
    21  
    22  	CreateKeyword(Keyword *Keyword) error
    23  	KeywordByID(id int) (*Keyword, error)
    24  	KeywordByName(name string) (*Keyword, error)
    25  	Keywords() ([]*Keyword, error)
    26  	UpdateKeyword(Keyword *Keyword) error
    27  	DeleteKeyword(Keyword *Keyword) error
    28  
    29  	CreateLog(Log *Log) error
    30  	LogByID(id int) (*Log, error)
    31  	LogByName(name string) (*Log, error)
    32  	Logs() ([]*Log, error)
    33  	UpdateLog(Log *Log) error
    34  	DeleteLog(Log *Log) error
    35  
    36  	CreatePost(Post *Post) error
    37  	PostByID(id int) (*Post, error)
    38  	PostByName(name string) (*Post, error)
    39  	Posts() ([]*Post, error)
    40  	UpdatePost(Post *Post) error
    41  	DeletePost(Post *Post) error
    42  
    43  	CreateReport(Report *Report) error
    44  	ReportByID(id int) (*Report, error)
    45  	ReportByName(name string) (*Report, error)
    46  	Reports() ([]*Report, error)
    47  	UpdateReport(Report *Report) error
    48  	DeleteReport(Report *Report) error
    49  }
    50  

View as plain text