database

package
v0.0.0-...-652cce4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 New

func New() *Database

New creates an empty Database struct

func (*Database) AnimeByIDExists

func (d *Database) AnimeByIDExists(id int) bool

AnimeByIDExists checks if an anime by id is in the anime table

func (*Database) AnimeByLinkExists

func (d *Database) AnimeByLinkExists(link string) bool

AnimeByLinkExists checks if an anime by link is in the anime table

func (*Database) AnimeByTitleExists

func (d *Database) AnimeByTitleExists(title string) bool

AnimeByTitleExists checks if an anime by id is in the anime table

func (*Database) Close

func (d *Database) Close()

Close closes the database connection

func (*Database) InsertAnime

func (d *Database) InsertAnime(anime *data.Anime) error

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) Open

func (d *Database) Open(name string) error

Open creates or opens the database to given name

func (*Database) RetrieveAnimeByID

func (d *Database) RetrieveAnimeByID(id int) (*data.Anime, error)

RetrieveAnimeByID retreives a row by an anime id from the anime table

func (d *Database) RetrieveAnimeByLink(link string) (*data.Anime, error)

RetrieveAnimeByLink retreives a row by an anime link from the anime table

func (*Database) RetrieveAnimeByTitle

func (d *Database) RetrieveAnimeByTitle(title string) (*data.Anime, error)

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

func (d *Database) UserAnimeListExists(username string) bool

UserAnimeListExists checks if the username is in the user_anime_list and user_anime table

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL