entity

package
v0.0.0-...-ef8624d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	gorm.Model

	DownloadID uint
	Download   *Download

	State BookState

	Title   string
	Author  string
	Reader  string
	Picture string
	Error   string
}

type BookState

type BookState string
const (
	BookStateDownload BookState = "download"
	BookStateError    BookState = "error"
	BookStateConvert  BookState = "convert"
	BookStateReady    BookState = "ready"
)

type Download

type Download struct {
	gorm.Model

	Name   string
	Magnet string `gorm:"index"`
	State  DownloadState

	Length     int64
	Downloaded int64
	Error      string
}

func NewDownload

func NewDownload(magnet string) *Download

type DownloadState

type DownloadState string
const (
	DownloadStateNew        DownloadState = "new"
	DownloadStateInProgress DownloadState = "in_progress"
	DownloadStateError      DownloadState = "error"
	DownloadStateDone       DownloadState = "done"
	DownloadStateDelete     DownloadState = "delete"
)

type LoginRequest

type LoginRequest struct {
	gorm.Model

	Email     string
	Code      string
	ExpiresAt time.Time
}

type Part

type Part struct {
	gorm.Model

	BookID uint
	Book   *Book

	Title string

	// TODO: rename to position
	Possition uint

	Source string

	Duration float64
}

func (*Part) Path

func (p *Part) Path() string

type Progress

type Progress struct {
	gorm.Model

	BookID uint
	Book   *Book

	UserID uint
	User   *User

	Part     uint
	Position float64
	Speed    float64
}

type User

type User struct {
	gorm.Model

	Email string
	Roles pq.StringArray `gorm:"type:text[]"`
}

Jump to

Keyboard shortcuts

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