storage

package
v0.0.0-...-3282c9b Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package storage implements Storage interface.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAffected = errors.New(`not affected`)

ErrNotAffected indicates no row affected as a result of the query.

View Source
var ErrUniqueViolation = errors.New(`ERROR: duplicate key value violates unique constraint "songs_idx" (SQLSTATE 23505)`)

ErrUniqueViolation indicates song unique constraint violation.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	Add(ctx context.Context, d models.Song) (models.Song, error)
	Update(ctx context.Context, id string, data models.RequestUpdateSong) error
	Delete(ctx context.Context, id string) error
	GetText(ctx context.Context, id string, page, size int) (models.ResponseGetSongText, error)
	GetSongs(ctx context.Context, d models.Song, page, size int) (models.ResponseGetSongs, error)
	Ping() error
	Close() error
}

Storage describes methods required to implement Storage.

func Open

func Open(ctx context.Context, cfg *config.Config) (Storage, error)

Open initializes Storage.

Jump to

Keyboard shortcuts

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