Versions in this module Expand all Collapse all v1 v1.0.1 Jul 22, 2017 Changes in this version + const SqliteType + const TorrentStatusAPlus + const TorrentStatusBlocked + const TorrentStatusNormal + const TorrentStatusRemake + const TorrentStatusTrusted + const UserStatusBanned + const UserStatusMember + const UserStatusModerator + const UserStatusScraped + const UserStatusTrusted + var ElasticSearchClient *elastic.Client + var IsSqlite bool + var ORM *gorm.DB + func ElasticSearchInit() (*elastic.Client, error) + func GormInit(conf *config.Config, logger Logger) (*gorm.DB, error) + type Activity struct + Content string + Filter string + ID uint + Identifier string + User *User + UserID uint + func NewActivity(identifier string, filter string, c ...string) Activity + func (a *Activity) TableName() string + func (a *Activity) ToLocale(T func(string, ...interface{}) template.HTML) template.HTML + type Comment struct + Content string + CreatedAt time.Time + DeletedAt *time.Time + ID uint + Torrent *Torrent + TorrentID uint + UpdatedAt time.Time + User *User + UserID uint + func (c *Comment) Identifier() string + func (c Comment) Size() int + func (c Comment) TableName() string + type CommentJSON struct + Content template.HTML + Date time.Time + UserAvatar string + UserID int + Username string + type DatabaseDump struct + Date time.Time + Filesize int64 + Name string + TorrentLink string + func (dump *DatabaseDump) ToJSON() DatabaseDumpJSON + type DatabaseDumpJSON struct + Date string + Filesize string + Name string + TorrentLink template.URL + type File struct + BencodedPath string + Filesize int64 + ID uint + TorrentID uint + func (f *File) Filename() string + func (f *File) Path() (out []string) + func (f *File) SetPath(path []string) error + func (f File) Size() int + func (f File) TableName() string + type FileJSON struct + Filesize int64 + Path string + type Language struct + ID uint + Name string + type Logger interface + Print func(v ...interface{}) + var DefaultLogger Logger + type Notification struct + Content string + ID uint + Identifier string + Read bool + URL string + UserID uint + func NewNotification(identifier string, c string, url string) Notification + func (n *Notification) TableName() string + type OldComment struct + Content string + Date time.Time + Torrent *Torrent + TorrentID uint + Username string + func (c OldComment) Size() int + func (c OldComment) TableName() string + type Scrape struct + Completed uint32 + LastScrape time.Time + Leechers uint32 + Seeders uint32 + TorrentID uint + func (t Scrape) TableName() string + type Torrent struct + AnidbID string + Category int + Comments []Comment + Date time.Time + DeletedAt *time.Time + Description string + FileList []File + Filesize int64 + Hash string + Hidden bool + ID uint + Language string + Languages []string + Name string + OldComments []OldComment + OldUploader string + Scrape *Scrape + Stardom int + Status int + SubCategory int + Trackers string + Uploader *User + UploaderID uint + WebsiteLink string + func (t *Torrent) DefinitelyDelete() (*Torrent, int, error) + func (t *Torrent) Delete(definitely bool) (*Torrent, int, error) + func (t *Torrent) DeleteFromESIndex(client *elastic.Client) error + func (t *Torrent) EncodeLanguages() + func (t *Torrent) GetTrackersArray() (trackers []string) + func (t *Torrent) Identifier() string + func (t *Torrent) IsAPlus() bool + func (t *Torrent) IsBlocked() bool + func (t *Torrent) IsDeleted() bool + func (t *Torrent) IsNormal() bool + func (t *Torrent) IsRemake() bool + func (t *Torrent) IsTrusted() bool + func (t *Torrent) ParseLanguages() + func (t *Torrent) ParseTrackers(trackers []string) + func (t *Torrent) ToJSON() TorrentJSON + func (t *Torrent) Update(unscope bool) (int, error) + func (t *Torrent) UpdateUnscope() (int, error) + func (t Torrent) AddToESIndex(client *elastic.Client) error + func (t Torrent) Size() (s int) + func (t Torrent) TableName() string + type TorrentJSON struct + AnidbID string + Category string + Comments []CommentJSON + Completed uint32 + Date string + Description template.HTML + FileList []FileJSON + Filesize int64 + Hash string + Hidden bool + ID uint + Languages []string + LastScrape time.Time + Leechers uint32 + Magnet template.URL + Name string + OldUploader template.HTML + Seeders uint32 + Status int + SubCategory string + TorrentLink template.URL + UploaderID uint + UploaderName template.HTML + WebsiteLink template.URL + func TorrentsToJSON(t []Torrent) []TorrentJSON + func (t *TorrentJSON) ToTorrent() Torrent + type TorrentReport struct + CreatedAt time.Time + Description string + ID uint + Torrent *Torrent + TorrentID uint + User *User + UserID uint + func (report *TorrentReport) Delete(definitely bool) (int, error) + func (report *TorrentReport) ToJSON() TorrentReportJSON + func (report TorrentReport) TableName() string + type TorrentReportJSON struct + Description string + ID uint + Torrent TorrentJSON + User UserJSON + func TorrentReportsToJSON(reports []TorrentReport) []TorrentReportJSON + type User struct + APIToken string + APITokenExpiry time.Time + CreatedAt time.Time + Email string + Followers []User + ID uint + Language string + Likings []User + MD5 string + Mascot string + MascotURL string + Notifications []Notification + Password string + Settings UserSettings + Status int + Theme string + Torrents []Torrent + UnreadNotifications int + UpdatedAt time.Time + UserSettings string + Username string + func (follower *User) IsFollower(u *User) bool + func (u *User) CanUpload() bool + func (u *User) CurrentOrAdmin(userID uint) bool + func (u *User) CurrentUserIdentical(userID uint) bool + func (u *User) Delete(currentUser *User) (int, error) + func (u *User) Filter() *User + func (u *User) GetFollowers() + func (u *User) GetLikings() + func (u *User) GetRole() string + func (u *User) GetUnreadNotifications() int + func (u *User) HasAdmin() bool + func (u *User) IsBanned() bool + func (u *User) IsMember() bool + func (u *User) IsModerator() bool + func (u *User) IsScraped() bool + func (u *User) IsTrusted() bool + func (u *User) NeedsCaptcha() bool + func (u *User) ParseSettings() + func (u *User) RemoveFollow(follower *User) + func (u *User) SaveSettings() + func (u *User) SetFollow(follower *User) + func (u *User) Splice(start int, length int) *User + func (u *User) ToJSON() UserJSON + func (u *User) Update() (int, error) + func (u *User) UpdateRaw() (int, error) + func (u User) Size() (s int) + type UserFollows struct + FollowerID uint + UserID uint + type UserJSON struct + APIToken string + CreatedAt string + ID uint + LikedCount int + LikingCount int + MD5 string + Status int + Username string + type UserSettings struct + Settings map[string]bool + func (s *UserSettings) Get(key string) bool + func (s *UserSettings) GetSettings() map[string]bool + func (s *UserSettings) Set(key string, val bool) + func (s *UserSettings) ToDefault() + type UserUploadsOld struct + TorrentID uint + Username string + func (c UserUploadsOld) TableName() string