db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToExperiences

func AddToExperiences(username, itemId string, itemType datastructure.ItemType, datetime time.Time) (int, error)

func AddToWantList

func AddToWantList(username, itemId string, itemType datastructure.ItemType) error

func CleanCache

func CleanCache() error

func CleanItemCache

func CleanItemCache() error

func ClearSessions

func ClearSessions(username string) error

func ClearSpecials

func ClearSpecials(username, itemId string, episodes []string, itemType datastructure.ItemType) error

func GetCacheItem

func GetCacheItem(itemType datastructure.ItemType, itemId string) (*datastructure.ItemInfo, error)

func GetItemExperiences

func GetItemExperiences(username, itemId string, itemType datastructure.ItemType) (map[string][]time.Time, error)

func GetReadlist added in v0.4.0

func GetReadlist(username, filter string, page int) (datastructure.Readlist, error)

func GetTvQueue

func GetTvQueue(username, filter string, page int) (datastructure.TvQueue, error)

func GetUserExperiences

func GetUserExperiences(username, filter string, page int) (datastructure.Experiences, error)

func GetWantlistUris added in v0.4.0

func GetWantlistUris() ([]string, error)

func GetWatchlist

func GetWatchlist(username, filter string, page int) (datastructure.Watchlist, error)

func InsertUser

func InsertUser(username, password, sfaSecret, recoveryCodes string) error

func IsOnWantList

func IsOnWantList(username, itemId string, itemType datastructure.ItemType) (bool, error)

func MakeAdmin

func MakeAdmin(username string) error

func Migrate

func Migrate() error

func RemoveCacheItem

func RemoveCacheItem(itemType datastructure.ItemType, itemId string) error

func RemoveFromWantList

func RemoveFromWantList(username, itemId string, itemType datastructure.ItemType) error

func RemoveSession

func RemoveSession(username, token string) error

func SaveCacheEntry

func SaveCacheEntry(uri, etag string, data []byte) error

func SaveCacheItem

func SaveCacheItem(itemType datastructure.ItemType, itemId string, itemInfo datastructure.ItemInfo, refs int) error

func UpdateCacheItem

func UpdateCacheItem(itemType datastructure.ItemType, itemId string, itemInfo datastructure.ItemInfo) error

func UpdateRecoveryCodes

func UpdateRecoveryCodes(username, recoveryCodes string) error

func WatchWholeSerie added in v0.4.0

func WatchWholeSerie(username, itemId string, episodes []string, itemType datastructure.ItemType, datetime time.Time) (int, error)

Types

type CacheEntry

type CacheEntry struct {
	Etag string
	Data []byte
}

func GetCacheEntry

func GetCacheEntry(uri string) (*CacheEntry, error)

type EmptyError

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

func (EmptyError) Error

func (e EmptyError) Error() string

type Session

type Session struct {
	Id       string
	Username string
	Expiry   time.Time
	IsLong   bool
}

func CreateSession

func CreateSession(username string, long bool) (Session, error)

func GetSession

func GetSession(token string) (*Session, error)

type User

type User struct {
	Username      string
	PasswordHash  string
	Sfa           string
	Avatar        []byte
	AvatarSmall   []byte
	IsAdmin       bool
	RecoveryCodes string
	Timezone      string
}

func GetUser

func GetUser(username string) (*User, error)

Jump to

Keyboard shortcuts

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