postgres

package
v0.0.0-...-c8675c7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func NewLogger

func NewLogger(cfg config.Config) *Logger

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, args ...any)

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, args ...any)

func (*Logger) LogMode

func (l *Logger) LogMode(level logger.LogLevel) logger.Interface

func (*Logger) Trace

func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, msg string, args ...any)

type MucaronTransactionKey

type MucaronTransactionKey struct{}

type PostgresClient

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

func NewPostgres

func NewPostgres(ctx context.Context, cfg config.Config) (*PostgresClient, error)

func (*PostgresClient) CreateAlbum

func (p *PostgresClient) CreateAlbum(ctx context.Context, a entity.Album) error

func (*PostgresClient) CreateArtist

func (p *PostgresClient) CreateArtist(ctx context.Context, a entity.Artist) error

func (*PostgresClient) CreateGenre

func (p *PostgresClient) CreateGenre(ctx context.Context, g entity.Genre) error

func (*PostgresClient) CreateMusic

func (p *PostgresClient) CreateMusic(ctx context.Context, m entity.Music) error

func (*PostgresClient) CreateUser

func (p *PostgresClient) CreateUser(ctx context.Context, u entity.User) error

func (*PostgresClient) DeleteAlbums

func (p *PostgresClient) DeleteAlbums(ctx context.Context, a []entity.Album) error

func (*PostgresClient) DeleteArtist

func (p *PostgresClient) DeleteArtist(ctx context.Context, a entity.Artist) error

func (*PostgresClient) DeleteGenre

func (p *PostgresClient) DeleteGenre(ctx context.Context, g entity.Genre) error

func (*PostgresClient) DeleteMusics

func (p *PostgresClient) DeleteMusics(ctx context.Context, musicIDs []uuid.UUID) error

func (*PostgresClient) DeleteUser

func (p *PostgresClient) DeleteUser(ctx context.Context, u entity.User) error

func (*PostgresClient) GetAlbumByID

func (p *PostgresClient) GetAlbumByID(ctx context.Context, id uuid.UUID) (entity.Album, error)

func (*PostgresClient) GetAlbumByIDs

func (p *PostgresClient) GetAlbumByIDs(ctx context.Context, ids []uuid.UUID) ([]entity.Album, error)

func (*PostgresClient) GetAlbumsByNameAndArtist

func (p *PostgresClient) GetAlbumsByNameAndArtist(ctx context.Context, ownerID uuid.UUID, albumName string, artist entity.Artist) ([]entity.Album, error)

func (*PostgresClient) GetArtistByID

func (p *PostgresClient) GetArtistByID(ctx context.Context, id uuid.UUID) (entity.Artist, error)

func (*PostgresClient) GetArtistByIDs

func (p *PostgresClient) GetArtistByIDs(ctx context.Context, ids []uuid.UUID) ([]entity.Artist, error)

func (*PostgresClient) GetArtistByName

func (p *PostgresClient) GetArtistByName(ctx context.Context, ownerID uuid.UUID, name string) (entity.Artist, error)

func (*PostgresClient) GetGenreByID

func (p *PostgresClient) GetGenreByID(ctx context.Context, id uuid.UUID) (entity.Genre, error)

func (*PostgresClient) GetGenreByIDs

func (p *PostgresClient) GetGenreByIDs(ctx context.Context, ids []uuid.UUID) ([]entity.Genre, error)

func (*PostgresClient) GetGenreByName

func (p *PostgresClient) GetGenreByName(ctx context.Context, ownerID uuid.UUID, name string) (entity.Genre, error)

func (*PostgresClient) GetMusicByFileHash

func (p *PostgresClient) GetMusicByFileHash(ctx context.Context, userID uuid.UUID, fileHash string, m *entity.Music) error

func (*PostgresClient) GetMusicByID

func (p *PostgresClient) GetMusicByID(ctx context.Context, id uuid.UUID) (entity.Music, error)

func (*PostgresClient) GetMusicByIDs

func (p *PostgresClient) GetMusicByIDs(ctx context.Context, ids []uuid.UUID) ([]entity.Music, error)

func (*PostgresClient) GetMusicIDsByUserID

func (p *PostgresClient) GetMusicIDsByUserID(ctx context.Context, userID uuid.UUID) ([]uuid.UUID, error)

func (*PostgresClient) GetMusicsByUserID

func (p *PostgresClient) GetMusicsByUserID(ctx context.Context, userID uuid.UUID) ([]entity.Music, error)

func (*PostgresClient) GetUserByID

func (p *PostgresClient) GetUserByID(ctx context.Context, userID uuid.UUID) (entity.User, error)

func (*PostgresClient) GetUserByIDs

func (p *PostgresClient) GetUserByIDs(ctx context.Context, userIDs []uuid.UUID) ([]entity.User, error)

func (*PostgresClient) GetUserByName

func (p *PostgresClient) GetUserByName(ctx context.Context, userName string) (entity.User, error)

func (*PostgresClient) HardDeleteMusic

func (p *PostgresClient) HardDeleteMusic(ctx context.Context, music entity.Music) error

func (*PostgresClient) UpdateAlbum

func (p *PostgresClient) UpdateAlbum(ctx context.Context, a entity.Album) error

func (*PostgresClient) UpdateArtist

func (p *PostgresClient) UpdateArtist(ctx context.Context, a entity.Artist) error

func (*PostgresClient) UpdateGenre

func (p *PostgresClient) UpdateGenre(ctx context.Context, g entity.Genre) error

func (*PostgresClient) UpdateMusic

func (p *PostgresClient) UpdateMusic(ctx context.Context, m entity.Music) error

func (*PostgresClient) UpdateMusicStatus

func (p *PostgresClient) UpdateMusicStatus(ctx context.Context, musicID uuid.UUID, status entity.MusicStatus) error

func (*PostgresClient) UpdateMusicStatuses

func (p *PostgresClient) UpdateMusicStatuses(ctx context.Context, musicIDs []uuid.UUID, status entity.MusicStatus) error

func (*PostgresClient) UpdateUser

func (p *PostgresClient) UpdateUser(ctx context.Context, u entity.User) error

Jump to

Keyboard shortcuts

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