db

package
v0.0.0-...-a1716bb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushDB

func FlushDB()

func InitRedisClient

func InitRedisClient(flashDB bool)

Types

type CookiesDB

type CookiesDB struct{}

func (CookiesDB) GetCookiesInfo

func (cDB CookiesDB) GetCookiesInfo() (cookieID2usernameMap map[string]string)

func (CookiesDB) SaveCookiesInfo

func (cDB CookiesDB) SaveCookiesInfo(cookieID2usernameMap map[string]string)

type CookiesDBClient

type CookiesDBClient interface {
	SaveCookiesInfo(cookieID2usernameMap map[string]string)
	GetCookiesInfo() (cookieID2usernameMap map[string]string)
}

func GetCookiesDBClient

func GetCookiesDBClient() CookiesDBClient

type SpotifyDB

type SpotifyDB struct{}

func (SpotifyDB) DeleteFavTracksSnapshot

func (sDB SpotifyDB) DeleteFavTracksSnapshot(username string, timestamp string) (*models.FavTracksSnapshot, error)

func (SpotifyDB) DeletePlaylistsSnapshot

func (sDB SpotifyDB) DeletePlaylistsSnapshot(username string, timestamp string) (*models.PlaylistsSnapshot, error)

func (SpotifyDB) GetAllFavTracksSnapshots

func (sDB SpotifyDB) GetAllFavTracksSnapshots(username string) []models.FavTracksSnapshot

func (SpotifyDB) GetAllPlaylistsSnapshots

func (sDB SpotifyDB) GetAllPlaylistsSnapshots(username string) []models.PlaylistsSnapshot

func (SpotifyDB) GetFavTracksSnapshot

func (sDB SpotifyDB) GetFavTracksSnapshot(key string) *models.FavTracksSnapshot

func (SpotifyDB) GetFavTracksSnapshotByTimestamp

func (sDB SpotifyDB) GetFavTracksSnapshotByTimestamp(username string, timestamp string) (*models.FavTracksSnapshot, error)

func (SpotifyDB) GetPlaylistsSnapshot

func (sDB SpotifyDB) GetPlaylistsSnapshot(key string) *models.PlaylistsSnapshot

func (SpotifyDB) GetPlaylistsSnapshotByTimestamp

func (sDB SpotifyDB) GetPlaylistsSnapshotByTimestamp(username string, timestamp string) (*models.PlaylistsSnapshot, error)

func (SpotifyDB) SaveFavTracksSnapshot

func (sDB SpotifyDB) SaveFavTracksSnapshot(ft *models.FavTracksSnapshot) (saved bool)

func (SpotifyDB) SavePlaylistsSnapshot

func (sDB SpotifyDB) SavePlaylistsSnapshot(ps *models.PlaylistsSnapshot) (saved bool)

type SpotifyDBClient

type SpotifyDBClient interface {
	SaveFavTracksSnapshot(ft *models.FavTracksSnapshot) (saved bool)
	SavePlaylistsSnapshot(ps *models.PlaylistsSnapshot) (saved bool)
	DeletePlaylistsSnapshot(username string, timestamp string) (*models.PlaylistsSnapshot, error)
	DeleteFavTracksSnapshot(username string, timestamp string) (*models.FavTracksSnapshot, error)
	GetPlaylistsSnapshotByTimestamp(username string, timestamp string) (*models.PlaylistsSnapshot, error)
	GetFavTracksSnapshotByTimestamp(username string, timestamp string) (*models.FavTracksSnapshot, error)
	GetPlaylistsSnapshot(key string) *models.PlaylistsSnapshot
	GetFavTracksSnapshot(key string) *models.FavTracksSnapshot
	GetAllFavTracksSnapshots(username string) []models.FavTracksSnapshot
	GetAllPlaylistsSnapshots(username string) []models.PlaylistsSnapshot
}

func GetSpotifyDBClient

func GetSpotifyDBClient() SpotifyDBClient

type UsersDBClient

type UsersDBClient interface {
	SaveUser(user *models.User) (stored bool)
	GetUser(username string) *models.User
	GetAllUsers() []models.User
}

func GetUsersDBClient

func GetUsersDBClient() UsersDBClient

type UsersDBRedisClient

type UsersDBRedisClient struct{}

func (*UsersDBRedisClient) GetAllUsers

func (uDB *UsersDBRedisClient) GetAllUsers() []models.User

func (*UsersDBRedisClient) GetUser

func (uDB *UsersDBRedisClient) GetUser(username string) *models.User

GetUser returns a user object from storage (redis) by username

func (*UsersDBRedisClient) SaveUser

func (uDB *UsersDBRedisClient) SaveUser(user *models.User) (stored bool)

type UsersDBTestClient

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

func NewUsersDBTest

func NewUsersDBTest(testUsers []models.User) *UsersDBTestClient

func (*UsersDBTestClient) GetAllUsers

func (c *UsersDBTestClient) GetAllUsers() []models.User

func (*UsersDBTestClient) GetUser

func (c *UsersDBTestClient) GetUser(username string) *models.User

func (*UsersDBTestClient) SaveUser

func (c *UsersDBTestClient) SaveUser(user *models.User) (stored bool)

Jump to

Keyboard shortcuts

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