storage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGPMCredentials = errors.New("No #AuthDetails bucket")
	ErrNoLastFMBucket   = errors.New("No #LastFM bucket")
	ErrNoLastFMRecord   = errors.New("No LastFM record in the database")
)
View Source
var (
	ErrNoLibraryFound  = errors.New("no library found")
	ErrLibraryNotFound = errors.New("library not found")
)

Functions

func GetArtistsAndAlbums added in v0.7.0

func GetArtistsAndAlbums(d *BoltDB) (sort.StringSlice, map[string]bool, map[string][]string)

GetArtistsAndAlbums returns the artists and albums. This code was moved from the UI package. This code is depricated.

func GetPlaylists added in v0.7.0

func GetPlaylists(d *BoltDB) sort.StringSlice

GetPlaylists returns the playlists. This code was moved from the UI package. This code is depricated.

func GetTracks added in v0.7.0

func GetTracks(d *BoltDB, what []string, view int, curPos, scrOffset map[bool]int, numAlb func(k int) int) map[string][]string

GetTracks returns the tracks. This code was moved from the UI package. This code is depricated.

func ReadCredentials

func ReadCredentials(db *bolt.DB) ([]byte, []byte, error)

func ReadLastFM added in v0.4.0

func ReadLastFM(db *bolt.DB) (string, error)

func WriteCredentials

func WriteCredentials(db *bolt.DB, auth string, deviceID string) error

func WriteLastFM added in v0.4.0

func WriteLastFM(lastfm []byte, db *bolt.DB) error

Types

type BoltDB added in v0.7.0

type BoltDB struct {
	Bolt    *bolt.DB
	LibName []byte
	// contains filtered or unexported fields
}

func Open

func Open(logger *jamsonic.Logger) (*BoltDB, error)

func (*BoltDB) AddPlaylists added in v0.7.0

func (d *BoltDB) AddPlaylists(provider jamsonic.Provider, playlists []*jamsonic.Playlist, entries []*jamsonic.PlaylistEntry) error

AddPlaylists stores the playlists in the database.

func (*BoltDB) AddTracks added in v0.7.0

func (d *BoltDB) AddTracks(tracks []*jamsonic.Track) error

AddTracks stores the tracks to the database.

func (*BoltDB) Artists added in v0.7.0

func (d *BoltDB) Artists() ([]*jamsonic.Artist, error)

func (*BoltDB) GetCredentials added in v0.7.0

func (d *BoltDB) GetCredentials(key []byte) ([]byte, error)

func (*BoltDB) SaveArtists added in v0.7.0

func (d *BoltDB) SaveArtists(artists []*jamsonic.Artist) error

func (*BoltDB) SaveCredentials added in v0.7.0

func (d *BoltDB) SaveCredentials(key []byte, credStruct []byte) error

Jump to

Keyboard shortcuts

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