Documentation ¶
Index ¶
- type Database
- func (d *Database) AnimeByIDExists(id int) bool
- func (d *Database) AnimeByLinkExists(link string) bool
- func (d *Database) AnimeByTitleExists(title string) bool
- func (d *Database) Close()
- func (d *Database) InsertAnime(anime *data.Anime) error
- func (d *Database) InsertUserAnimeList(userAnimeList *data.UserAnimeList) error
- func (d *Database) Open(name string) error
- func (d *Database) RetrieveAnimeByID(id int) (*data.Anime, error)
- func (d *Database) RetrieveAnimeByLink(link string) (*data.Anime, error)
- func (d *Database) RetrieveAnimeByTitle(title string) (*data.Anime, error)
- func (d *Database) RetrieveUserAnimeList(username string) (*data.UserAnimeList, error)
- func (d *Database) UserAnimeListExists(username string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database holds the connection to a sqlite 3 database
func (*Database) AnimeByIDExists ¶
AnimeByIDExists checks if an anime by id is in the anime table
func (*Database) AnimeByLinkExists ¶
AnimeByLinkExists checks if an anime by link is in the anime table
func (*Database) AnimeByTitleExists ¶
AnimeByTitleExists checks if an anime by id is in the anime table
func (*Database) InsertAnime ¶
InsertAnime inserts an Anime struct into the anime table
func (*Database) InsertUserAnimeList ¶
func (d *Database) InsertUserAnimeList(userAnimeList *data.UserAnimeList) error
InsertUserAnimeList saves the user's anime list
func (*Database) RetrieveAnimeByID ¶
RetrieveAnimeByID retreives a row by an anime id from the anime table
func (*Database) RetrieveAnimeByLink ¶
RetrieveAnimeByLink retreives a row by an anime link from the anime table
func (*Database) RetrieveAnimeByTitle ¶
RetrieveAnimeByTitle retreives a row by an anime id from the anime table
func (*Database) RetrieveUserAnimeList ¶
func (d *Database) RetrieveUserAnimeList(username string) (*data.UserAnimeList, error)
RetrieveUserAnimeList retrieves a user's anime list
func (*Database) UserAnimeListExists ¶
UserAnimeListExists checks if the username is in the user_anime_list and user_anime table