user

package
v0.0.0-...-7b5ece9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID            int
	CreatedAt     time.Time
	UpdatedAt     time.Time
	TelegramID    int
	TelegramName  string
	FeedID        string
	FeedCheckedAt time.Time
	Torrents      []torrent.Torrent `pg:",many2many:user_torrents"`
}

User (i.e. Downloader)

func (*User) AppendTorrent

func (u *User) AppendTorrent(t *torrent.Torrent) error

AppendTorrent apeend Torrent to User

func (*User) BeforeInsert

func (u *User) BeforeInsert(db orm.DB) error

BeforeInsert hook

func (*User) BeforeUpdate

func (u *User) BeforeUpdate(db orm.DB) error

BeforeUpdate hook

func (*User) ClearTorrents

func (u *User) ClearTorrents() (int, error)

ClearTorrents clear User Torrent history

func (*User) CountTorrents

func (u *User) CountTorrents() (int, error)

CountTorrents count User Torrents

func (*User) FeedURL

func (u *User) FeedURL() string

FeedURL returns User’s feed URL

func (*User) GenerateFeed

func (u *User) GenerateFeed() (string, error)

GenerateFeed returns User’s feed

func (*User) GetByFeedID

func (u *User) GetByFeedID() (*User, error)

GetByFeedID find User by FeedID

func (*User) IsFeedActive

func (u *User) IsFeedActive() bool

IsFeedActive tells if the User’s feed has been requested recently

func (*User) RenewFeedChecked

func (u *User) RenewFeedChecked() error

RenewFeedChecked renews User’s FeedCheckedAt

type UserTorrent

type UserTorrent struct {
	UserID               int
	TorrentID            int
	Torrent_DownloadedAt time.Time // nolint
}

UserTorrent is about which user download what torrents

Jump to

Keyboard shortcuts

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