uguu

package
v0.0.0-...-c57407d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

package uguu implements uguu-tracker storage driver using postgres

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UguuSQL

type UguuSQL struct {
	// contains filtered or unexported fields
}

func (*UguuSQL) AddTorrent

func (u *UguuSQL) AddTorrent(torrent *models.Torrent) (err error)

add a torrent to the database

func (*UguuSQL) AddUser

func (u *UguuSQL) AddUser(user *models.User) (err error)

add a user to the database

func (*UguuSQL) Close

func (u *UguuSQL) Close() (err error)

close connection to database

func (*UguuSQL) DeleteTorrent

func (u *UguuSQL) DeleteTorrent(torrent *models.Torrent) (err error)

delete an already existing torrent

func (*UguuSQL) DeleteUser

func (u *UguuSQL) DeleteUser(user *models.User) (err error)

func (*UguuSQL) GeneratePasskey

func (u *UguuSQL) GeneratePasskey() (key string)

generate a new passkey that doesn't exist in the database already

func (*UguuSQL) GetCategories

func (u *UguuSQL) GetCategories() (cats []*models.TorrentCategory, err error)

func (*UguuSQL) GetTorrentByInfoHash

func (u *UguuSQL) GetTorrentByInfoHash(infohash string) (t *models.Torrent, err error)

func (*UguuSQL) GetUserByPassKey

func (u *UguuSQL) GetUserByPassKey(passkey string) (user *models.User, err error)

func (*UguuSQL) InitTables

func (u *UguuSQL) InitTables() (err error)

create initial version 0 tables

func (*UguuSQL) LatestVersion

func (u *UguuSQL) LatestVersion(version string) (latest bool)

return true if the version string is the latest version

func (*UguuSQL) LoadTorrents

func (u *UguuSQL) LoadTorrents(ids []uint64) (torrents []*models.Torrent, err error)

func (*UguuSQL) LoadUsers

func (u *UguuSQL) LoadUsers(ids []uint64) (users []*models.User, err error)

load users given an array of ids

func (*UguuSQL) Migrate

func (u *UguuSQL) Migrate() (err error)

run all migrations

func (*UguuSQL) Ping

func (u *UguuSQL) Ping() (err error)

ping backend

func (*UguuSQL) RecordAnnounce

func (u *UguuSQL) RecordAnnounce(delta *models.AnnounceDelta) (err error)

record that a bittorrent announce happened

func (*UguuSQL) UpgradeToNext

func (u *UguuSQL) UpgradeToNext(version string) (err error)

upgrade to the next database version given the current version

func (*UguuSQL) Version

func (u *UguuSQL) Version() (version string, err error)

what database version are we at

Jump to

Keyboard shortcuts

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