db

package
v0.0.0-...-df076cb Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Holds a connection to an SQL database as well as the prepared statements for interacting with the database

func NewConnection

func NewConnection(databaseFile string) (*Connection, error)

Creates a new connection to the given database file that can be queried for tracks

func (*Connection) GetTracks

func (c *Connection) GetTracks(trackName string) []Track

Queries the database for tracks containing the given trackName. This is case-insensitive

type Track

type Track struct {
	Id           uint   `json:"id"`
	TrackName    string `json:"trackName"`
	ArtistName   string `json:"artistName"`
	AlbumName    string `json:"albumName"`
	Milliseconds uint   `json:"milliseconds"`
	Bytes        uint   `json:"bytes"`
}

Holds the data that is queryable from the database

Jump to

Keyboard shortcuts

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