dblayer

package
v0.0.0-...-1876e9c Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(db ChordsDB) error

Fill fills a ChordsDB with some sample data - good for demonstration and/or testing.

func NewLocalfs

func NewLocalfs(basedir string, logger *log.Logger) *localfs

func NewPostgres

func NewPostgres(url string) (*postgres, error)

NewPostgres creates and initialises a Postgres DB at the given URL.

func NewTempDB

func NewTempDB() *tempDB

Return a correctly initialised tempDB.

Types

type Chords

type Chords []byte

type ChordsDB

type ChordsDB interface {
	GetArtists() ([]string, error)
	GetSongs(artist, id, query string) ([]SongMeta, error)
	NewSong(SongMeta) (SongMeta, error)
	UpdateSong(id string, meta SongMeta) (SongMeta, error)
	DeleteSong(id string) error
	GetChords(id string) (Chords, error)
	UpdateChords(id string, chords Chords) (Chords, error)
	SeeAlso(artist string) ([]string, error)
	Search(query string) ([]SongMeta, error)
}

ChordsDB is the data abstraction used for the chords v0 API.

func GetDB

func GetDB(url string, logger *log.Logger) (ChordsDB, error)

type SongMeta

type SongMeta = types.SongMeta

Jump to

Keyboard shortcuts

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