data_store

package
v0.0.0-...-a8d8f77 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

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

func NewDataStore

func NewDataStore(db *sql.DB, secret string) *DataStore

func (*DataStore) ClearCachedResponsesForPath

func (ds *DataStore) ClearCachedResponsesForPath(path, userId string)

func (*DataStore) CreateTables

func (ds *DataStore) CreateTables() error

func (*DataStore) InsertLastfmCachedResponse

func (ds *DataStore) InsertLastfmCachedResponse(lastfmCachedResponse *LastfmCachedResponse) error

func (*DataStore) InsertSpotifyCachedResponse

func (ds *DataStore) InsertSpotifyCachedResponse(spotifyCachedResponse *SpotifyCachedResponse) error

func (*DataStore) LoadCachedLastfmResponse

func (ds *DataStore) LoadCachedLastfmResponse(method, params, username string) string

func (*DataStore) LoadCachedSpotifyResponse

func (ds *DataStore) LoadCachedSpotifyResponse(path, params, userId string) string

func (*DataStore) LoadLastfmUser

func (ds *DataStore) LoadLastfmUser(name string) (*LastfmUser, error)

func (*DataStore) LoadSpotifyUser

func (ds *DataStore) LoadSpotifyUser(id string) (*SpotifyUser, error)

func (*DataStore) PruneExpiredLastfmCachedResponsesIfNecessary

func (ds *DataStore) PruneExpiredLastfmCachedResponsesIfNecessary()

func (*DataStore) PruneExpiredSpotifyCachedResponsesIfNecessary

func (ds *DataStore) PruneExpiredSpotifyCachedResponsesIfNecessary()

func (*DataStore) TotalExpiredLastfmCachedResponses

func (ds *DataStore) TotalExpiredLastfmCachedResponses() (int, error)

func (*DataStore) TotalExpiredSpotifyCachedResponses

func (ds *DataStore) TotalExpiredSpotifyCachedResponses() (int, error)

func (*DataStore) UpsertLastfmUser

func (ds *DataStore) UpsertLastfmUser(lastfmUser *LastfmUser) error

func (*DataStore) UpsertSpotifyUser

func (ds *DataStore) UpsertSpotifyUser(spotifyUser *SpotifyUser) error

type LastfmCachedResponse

type LastfmCachedResponse struct {
	Timestamp string
	Body      string
	Method    string
	Params    string
	Username  string
}

func NewLastfmCachedResponse

func NewLastfmCachedResponse(obj any, method, params, username string) (*LastfmCachedResponse, error)

type LastfmUser

type LastfmUser struct {
	Name       string
	SessionKey string
}

type SpotifyCachedResponse

type SpotifyCachedResponse struct {
	Timestamp string
	Body      string
	Path      string
	Params    string
	UserId    string
}

func NewSpotifyCachedResponse

func NewSpotifyCachedResponse(obj any, path, params, userId string) (*SpotifyCachedResponse, error)

type SpotifyUser

type SpotifyUser struct {
	Id           string
	AccessToken  string
	RefreshToken string
	Scopes       string
	ExpiresIn    int
}

Jump to

Keyboard shortcuts

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