data

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package data provides abstraction for interacting with the data store of choice. In the case of audiofile, this will be with the local sqlite db.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Errors []error
	// contains filtered or unexported fields
}

Data provides a struct to house the database connection so methods can be attached to work with data.

func Open

func Open() (*Data, error)

Open will setup the sqlite file and db handle.

func (*Data) CaptureFile

func (d *Data) CaptureFile() error

CaptureFile will take a full found file and capture the data points within the database.

func (*Data) DeleteDirectory

func (d *Data) DeleteDirectory(dir audiofile.Directory) error

DeleteDirectory will accept an existing directory reference and remove it from the database.

func (*Data) GetAlbums

func (d *Data) GetAlbums() []audiofile.Album

GetAlbums will retrieve a slice of Album entries.

func (*Data) GetArtists

func (d *Data) GetArtists() []audiofile.Artist

GetArtists will retrieve a slice of Artist entries.

func (*Data) GetDirectories

func (d *Data) GetDirectories() ([]audiofile.Directory, error)

GetDirectories will provide a list of all known directories.

func (*Data) StoreDirectory

func (d *Data) StoreDirectory(dir audiofile.Directory) (audiofile.Directory, error)

StoreDirectory will take a Directory and push it into the database.

Jump to

Keyboard shortcuts

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