Documentation ¶
Index ¶
- Variables
- func ApiTokenQuery() *goqu.SelectDataset
- func ChapterQuery() *goqu.SelectDataset
- func SerieQuery() *goqu.SelectDataset
- func UserQuery() *goqu.SelectDataset
- func UserSettingsQuery() *goqu.SelectDataset
- type ApiToken
- type Bookmark
- type Chapter
- type ChapterChanges
- type Config
- type Connection
- type CreateApiTokenParams
- type CreateChapterParams
- type CreateSerieParams
- type CreateUserParams
- type Database
- func (db *Database) Begin() (*Database, *sqlx.Tx, error)
- func (db *Database) CreateApiToken(ctx context.Context, params CreateApiTokenParams) (ApiToken, error)
- func (db *Database) CreateBookmark(ctx context.Context, userId, serieId, chapterId string) error
- func (db *Database) CreateChapter(ctx context.Context, params CreateChapterParams) (Chapter, error)
- func (db *Database) CreateConfig(ctx context.Context, ownerId string) (Config, error)
- func (db *Database) CreateSerie(ctx context.Context, params CreateSerieParams) (Serie, error)
- func (db *Database) CreateUser(ctx context.Context, params CreateUserParams) (User, error)
- func (db *Database) DeleteSerie(ctx context.Context, id string) error
- func (db *Database) Exec(ctx context.Context, s ToSQL) (sql.Result, error)
- func (db *Database) Get(dest any, s ToSQL) error
- func (db *Database) GetAllApiTokensForUser(ctx context.Context, userId string) ([]ApiToken, error)
- func (db *Database) GetAllChapters(ctx context.Context) ([]Chapter, error)
- func (db *Database) GetAllMarkedChapters(ctx context.Context, userId, serieId string) ([]string, error)
- func (db *Database) GetAllSeries(ctx context.Context, nameFilter string) ([]Serie, error)
- func (db *Database) GetAllUsers(ctx context.Context) ([]User, error)
- func (db *Database) GetApiTokenById(ctx context.Context, id string) (ApiToken, error)
- func (db *Database) GetBookmark(ctx context.Context, userId, serieId string) (Bookmark, error)
- func (db *Database) GetChapterById(ctx context.Context, id string) (Chapter, error)
- func (db *Database) GetConfig(ctx context.Context) (*Config, error)
- func (db *Database) GetSerieById(ctx context.Context, id string) (Serie, error)
- func (db *Database) GetSerieChapters(ctx context.Context, serieId string) ([]Chapter, error)
- func (db *Database) GetUserById(ctx context.Context, id string) (User, error)
- func (db *Database) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (db *Database) GetUserSettingsById(ctx context.Context, id string) (UserSettings, error)
- func (db *Database) HasBookmark(ctx context.Context, userId, serieId string) (bool, error)
- func (db *Database) IsChapterMarked(ctx context.Context, userId, chapterId string) (bool, error)
- func (db *Database) MarkChapter(ctx context.Context, userId, chapterId string) error
- func (db *Database) Query(ctx context.Context, s ToSQL) (*sql.Rows, error)
- func (db *Database) QueryRow(ctx context.Context, s ToSQL) (*sql.Row, error)
- func (db *Database) RecalculateNumberForSerie(ctx context.Context, serieId string) error
- func (db *Database) RemoveApiToken(ctx context.Context, id string) error
- func (db *Database) RemoveChapter(ctx context.Context, id string) error
- func (db *Database) RunMigrateDown() error
- func (db *Database) RunMigrateUp() error
- func (db *Database) Select(dest any, s ToSQL) error
- func (db *Database) UnmarkChapter(ctx context.Context, userId, chapterId string) error
- func (db *Database) UpdateBookmark(ctx context.Context, userId, serieId, chapterId string) error
- func (db *Database) UpdateChapter(ctx context.Context, id string, changes ChapterChanges) error
- func (db *Database) UpdateSerie(ctx context.Context, id string, changes SerieChanges) error
- func (db *Database) UpdateUser(ctx context.Context, id string, changes UserChanges) error
- func (db *Database) UpdateUserSettings(ctx context.Context, settings UserSettings) error
- type Serie
- type SerieChanges
- type ToSQL
- type User
- type UserChanges
- type UserSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyMarked = errors.New("database: chapter already marked")
View Source
var ErrItemAlreadyExists = errors.New("database: item already exists")
View Source
var ErrItemNotFound = errors.New("database: item not found")
Functions ¶
func ApiTokenQuery ¶ added in v0.10.0
func ApiTokenQuery() *goqu.SelectDataset
func ChapterQuery ¶ added in v0.10.0
func ChapterQuery() *goqu.SelectDataset
func SerieQuery ¶ added in v0.10.0
func SerieQuery() *goqu.SelectDataset
func UserSettingsQuery ¶ added in v0.10.0
func UserSettingsQuery() *goqu.SelectDataset
Types ¶
type ChapterChanges ¶ added in v0.10.0
type Connection ¶ added in v0.3.0
type CreateApiTokenParams ¶ added in v0.10.0
type CreateChapterParams ¶ added in v0.10.0
type CreateSerieParams ¶ added in v0.10.0
type CreateSerieParams struct { Id string Name string CoverArt sql.NullString MalId sql.NullString AnilistId sql.NullString Created int64 Updated int64 }
type CreateUserParams ¶ added in v0.10.0
type Database ¶
type Database struct { NewRawConn *sqlx.DB RawConn *sql.DB Conn Connection }
func (*Database) CreateApiToken ¶ added in v0.10.0
func (*Database) CreateBookmark ¶
func (*Database) CreateChapter ¶
func (*Database) CreateConfig ¶ added in v0.3.0
func (*Database) CreateSerie ¶
func (*Database) CreateUser ¶
func (*Database) DeleteSerie ¶ added in v0.10.0
func (*Database) GetAllApiTokensForUser ¶ added in v0.10.0
func (*Database) GetAllChapters ¶
func (*Database) GetAllMarkedChapters ¶
func (*Database) GetAllSeries ¶
TODO(patrik): nameFilter is temporary
func (*Database) GetAllUsers ¶ added in v0.10.0
func (*Database) GetApiTokenById ¶ added in v0.10.0
func (*Database) GetBookmark ¶
func (*Database) GetChapterById ¶ added in v0.10.0
func (*Database) GetSerieById ¶
func (*Database) GetSerieChapters ¶ added in v0.10.0
func (*Database) GetUserById ¶
func (*Database) GetUserByUsername ¶
func (*Database) GetUserSettingsById ¶ added in v0.10.0
func (*Database) HasBookmark ¶
func (*Database) IsChapterMarked ¶
func (*Database) MarkChapter ¶
TODO(patrik): Fix
func (*Database) RecalculateNumberForSerie ¶ added in v0.10.0
func (*Database) RemoveApiToken ¶ added in v0.10.0
func (*Database) RemoveChapter ¶ added in v0.10.0
func (*Database) RunMigrateDown ¶ added in v0.10.0
func (*Database) RunMigrateUp ¶ added in v0.9.0
func (*Database) UnmarkChapter ¶
func (*Database) UpdateBookmark ¶
func (*Database) UpdateChapter ¶ added in v0.10.0
func (*Database) UpdateSerie ¶ added in v0.10.0
func (*Database) UpdateUser ¶ added in v0.10.0
func (*Database) UpdateUserSettings ¶ added in v0.10.0
func (db *Database) UpdateUserSettings(ctx context.Context, settings UserSettings) error
type Serie ¶
type Serie struct { Id string `db:"id"` Name string `db:"name"` CoverArt sql.NullString `db:"cover_art"` MalId sql.NullString `db:"mal_id"` AnilistId sql.NullString `db:"anilist_id"` Created int64 `db:"created"` Updated int64 `db:"updated"` ChapterCount int64 `db:"chapter_count"` }
type SerieChanges ¶ added in v0.10.0
type User ¶
type User struct { Id string `db:"id"` Username string `db:"username"` Password string `db:"password"` Role string `db:"role"` Created int64 `db:"created"` Updated int64 `db:"updated"` // NOTE(patrik): This needs to match UserSettings DisplayName sql.NullString `db:"display_name"` QuickPlaylist sql.NullString `db:"quick_playlist"` }
func (User) ToUserSettings ¶ added in v0.10.0
func (u User) ToUserSettings() UserSettings
type UserChanges ¶ added in v0.10.0
type UserSettings ¶ added in v0.10.0
type UserSettings struct { Id string `db:"id"` DisplayName sql.NullString `db:"display_name"` QuickPlaylist sql.NullString `db:"quick_playlist"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.