database

package
v0.0.0-...-33f95b3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	Id            int `gorm:"primary_key;AUTO_INCREMENT"`
	Url           string
	Name          string
	Number        string
	TimeStampUnix int64
	MangaId       int
}

func NewChapter

func NewChapter(id int, mangaId int, url string, name string, number string, timeStampUnix int64) Chapter

type Manager

type Manager struct {
	ConnectionString   string
	Db                 *gorm.DB
	CreateIfNotExists  bool
	ActivateGormLogger bool
}

func NewDatabase

func NewDatabase(connectionString string, createIfNotExists bool, activateGormLogger bool) Manager

func (*Manager) Close

func (dbMgr *Manager) Close() error

func (*Manager) Delete

func (dbMgr *Manager) Delete(mangaId int)

func (*Manager) Open

func (dbMgr *Manager) Open() error

type Manga

type Manga struct {
	Id             int `gorm:"primary_key;AUTO_INCREMENT"`
	Title          string
	TimeStampUnix  int64
	Thumbnail      []byte
	LastChapterNum string
	Chapters       []Chapter
	Enabled        bool
}

func NewManga

func NewManga(id int, title string, timeStampUnix int64) Manga

func (*Manga) GetLatestChapter

func (m *Manga) GetLatestChapter() (*Chapter, bool)

GetLatestChapter TODO: Cache this somehow

type Setting

type Setting struct {
	Name    string `gorm:"PRIMARY_KEY"`
	Value   string
	Default string
}

func NewSetting

func NewSetting(name string, defaultValue string) Setting

Jump to

Keyboard shortcuts

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