database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	CoverArt string `json:"coverArt"`
	ArtistID string `json:"artistId"`
	Path     string `json:"path"`
}

type Artist

type Artist struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
	Path    string `json:"path"`
}

type CreateAlbumParams

type CreateAlbumParams struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Path     string `json:"path"`
	CoverArt string `json:"coverArt"`
	ArtistID string `json:"artistId"`
}

type CreateArtistParams

type CreateArtistParams struct {
	ID      string `json:"id"`
	Path    string `json:"path"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
}

type CreateTrackParams

type CreateTrackParams struct {
	ID                string `json:"id"`
	TrackNumber       int32  `json:"trackNumber"`
	Name              string `json:"name"`
	Path              string `json:"path"`
	CoverArt          string `json:"coverArt"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumID           string `json:"albumId"`
	ArtistID          string `json:"artistId"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetAlbumsByArtistAndNameParams added in v0.2.3

type GetAlbumsByArtistAndNameParams struct {
	ArtistID string `json:"artistId"`
	Name     string `json:"name"`
}

type GetAllTracksRow

type GetAllTracksRow struct {
	ID                string `json:"id"`
	TrackNumber       int32  `json:"trackNumber"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	Path              string `json:"path"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumID           string `json:"albumId"`
	ArtistID          string `json:"artistId"`
	AlbumName         string `json:"albumName"`
	ArtistName        string `json:"artistName"`
}

type GetTrackRow

type GetTrackRow struct {
	ID                string `json:"id"`
	TrackNumber       int32  `json:"trackNumber"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	Path              string `json:"path"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumID           string `json:"albumId"`
	ArtistID          string `json:"artistId"`
	AlbumName         string `json:"albumName"`
	ArtistName        string `json:"artistName"`
}

type GetTracksByAlbumRow

type GetTracksByAlbumRow struct {
	ID                string `json:"id"`
	TrackNumber       int32  `json:"trackNumber"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	Path              string `json:"path"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumID           string `json:"albumId"`
	ArtistID          string `json:"artistId"`
	AlbumName         string `json:"albumName"`
	ArtistName        string `json:"artistName"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAlbum

func (q *Queries) CreateAlbum(ctx context.Context, arg CreateAlbumParams) (Album, error)

func (*Queries) CreateArtist

func (q *Queries) CreateArtist(ctx context.Context, arg CreateArtistParams) (Artist, error)

func (*Queries) CreateTrack

func (q *Queries) CreateTrack(ctx context.Context, arg CreateTrackParams) (Track, error)

func (*Queries) DeleteAllAlbums

func (q *Queries) DeleteAllAlbums(ctx context.Context) error

func (*Queries) DeleteAllArtists

func (q *Queries) DeleteAllArtists(ctx context.Context) error

func (*Queries) DeleteAllTracks

func (q *Queries) DeleteAllTracks(ctx context.Context) error

func (*Queries) GetAlbum

func (q *Queries) GetAlbum(ctx context.Context, id string) (Album, error)

func (*Queries) GetAlbumByPath added in v0.3.0

func (q *Queries) GetAlbumByPath(ctx context.Context, path string) (Album, error)

func (*Queries) GetAlbumsByArtist

func (q *Queries) GetAlbumsByArtist(ctx context.Context, artistID string) ([]Album, error)

func (*Queries) GetAlbumsByArtistAndName added in v0.2.3

func (q *Queries) GetAlbumsByArtistAndName(ctx context.Context, arg GetAlbumsByArtistAndNameParams) ([]Album, error)

func (*Queries) GetAllAlbums

func (q *Queries) GetAllAlbums(ctx context.Context) ([]Album, error)

func (*Queries) GetAllArtists

func (q *Queries) GetAllArtists(ctx context.Context) ([]Artist, error)

func (*Queries) GetAllTracks

func (q *Queries) GetAllTracks(ctx context.Context) ([]GetAllTracksRow, error)

func (*Queries) GetArtist

func (q *Queries) GetArtist(ctx context.Context, id string) (Artist, error)

func (*Queries) GetArtistByName added in v0.2.1

func (q *Queries) GetArtistByName(ctx context.Context, name string) ([]Artist, error)

func (*Queries) GetArtistByPath added in v0.3.0

func (q *Queries) GetArtistByPath(ctx context.Context, path string) (Artist, error)

func (*Queries) GetTrack

func (q *Queries) GetTrack(ctx context.Context, id string) (GetTrackRow, error)

func (*Queries) GetTrackByPath added in v0.3.0

func (q *Queries) GetTrackByPath(ctx context.Context, path string) (Track, error)

func (*Queries) GetTracksByAlbum

func (q *Queries) GetTracksByAlbum(ctx context.Context, albumID string) ([]GetTracksByAlbumRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Track

type Track struct {
	ID                string `json:"id"`
	TrackNumber       int32  `json:"trackNumber"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	Path              string `json:"path"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumID           string `json:"albumId"`
	ArtistID          string `json:"artistId"`
}

Jump to

Keyboard shortcuts

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