postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(host, user, database string) error

Types

type DB

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

func Init

func Init(ctx context.Context, opts Opts, logger *slog.Logger) (*DB, error)

func (*DB) AddPlayedAlbum

func (d *DB) AddPlayedAlbum(ctx context.Context, album client.AlbumFull) error

func (*DB) AddPlaylist

func (d *DB) AddPlaylist(ctx context.Context, title, description string) error

func (*DB) AddStreamingAlbum

func (d *DB) AddStreamingAlbum(ctx context.Context, album *streaming.AlbumFull) error

func (*DB) AddStreamingArtist

func (d *DB) AddStreamingArtist(ctx context.Context, artist *streaming.Artist) error

func (*DB) AddStreamingTrackToPlaylist

func (d *DB) AddStreamingTrackToPlaylist(ctx context.Context, playlistID uuid.UUID, track *streaming.Track) error

func (*DB) AddTrackToPlaylist

func (d *DB) AddTrackToPlaylist(ctx context.Context, playlistID uuid.UUID, trackID uuid.UUID) error

func (*DB) DeleteFileTrack

func (d *DB) DeleteFileTrack(ctx context.Context, id uuid.UUID) error

func (*DB) GetAlbumFull

func (d *DB) GetAlbumFull(ctx context.Context, id uuid.UUID) (libModel.AlbumFull, error)

func (*DB) GetAlbums

func (d *DB) GetAlbums(ctx context.Context, sortBy string, offset int, limit int) ([]libModel.AlbumWithArtists, error)

func (*DB) GetAllFileTracks

func (d *DB) GetAllFileTracks(ctx context.Context) ([]libModel.Track, error)

func (*DB) GetAllPlaylists

func (d *DB) GetAllPlaylists(ctx context.Context) ([]libModel.Playlist, error)

func (*DB) GetArtistFull

func (d *DB) GetArtistFull(ctx context.Context, id uuid.UUID) (libModel.ArtistFull, error)

func (*DB) GetArtists

func (d *DB) GetArtists(ctx context.Context) ([]libModel.Artist, error)

func (*DB) GetFileTrack

func (d *DB) GetFileTrack(ctx context.Context, path string) (libModel.Track, error)

func (*DB) GetLastRun

func (d *DB) GetLastRun(ctx context.Context) (time.Time, error)

func (*DB) GetPlayedAlbums

func (d *DB) GetPlayedAlbums(ctx context.Context, offset int, limit int) ([]libModel.PlayedAlbum, error)

func (*DB) GetPlaylistFull

func (d *DB) GetPlaylistFull(ctx context.Context, id uuid.UUID) (libModel.PlaylistFull, error)

func (*DB) GetStreamingAlbum

func (d *DB) GetStreamingAlbum(ctx context.Context, id string) (libModel.Album, error)

func (*DB) GetStreamingAlbumFull

func (d *DB) GetStreamingAlbumFull(ctx context.Context, id string) (libModel.AlbumFull, error)

func (*DB) GetStreamingArtist

func (d *DB) GetStreamingArtist(ctx context.Context, id string) (libModel.Artist, error)

func (*DB) GetStreamingArtistFull

func (d *DB) GetStreamingArtistFull(ctx context.Context, id string) (libModel.ArtistFull, error)

func (*DB) GetTrack

func (d *DB) GetTrack(ctx context.Context, id uuid.UUID) (libModel.Track, error)

func (*DB) Search

func (d *DB) Search(ctx context.Context, query string, limit int) (libModel.SearchRes, error)

func (*DB) SetLastRun

func (d *DB) SetLastRun(ctx context.Context, time time.Time) error

func (*DB) SyncFileTrack

func (d *DB) SyncFileTrack(ctx context.Context, track files.TrackFull) error

type Opts

type Opts struct {
	Host     string
	User     string
	Password string
	Database string
	Port     int
}

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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