data

package
v0.0.0-...-e77e068 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPlaylist

func AddPlaylist(name, description string) error

func AddSong

func AddSong(name, artist, source string) (string, error)

func AddSongToPlaylist

func AddSongToPlaylist(song, playlist string) error

func RemovePlaylist

func RemovePlaylist(playlist string)

func RemoveSong

func RemoveSong(song string)

func RemoveSongFromPlaylist

func RemoveSongFromPlaylist(song, playlist string) error

func SaveData

func SaveData(fileloc string, structdata Data) error

Types

type Data

type Data struct {
	Version   int                 `json:"Version"`
	Playlists map[string]Playlist `json:"Playlists"`
	Songs     map[string]Song     `json:"Songs"`
}
var Userdata Data

func LoadData

func LoadData(location string) (Data, error)

type Playlist

type Playlist struct {
	Name         string   `json:"Name"`
	Description  string   `json:"Description"`
	CreationDate int32    `json:"CreationDate"` // use UnixDate format
	LastUpdated  int32    `json:"LastUpdated"`  // use UnixDate format
	Contents     []string `json:"Contents"`
}

type Song

type Song struct {
	Name      string `json:"Name"`
	Artist    string `json:"Artist"`
	Source    string `json:"Source"`
	TrimStart string `json:"TrimStart"`
	TrimEnd   string `json:"TrimEnd"`
	Duration  string `json:"Duration"`
}

Directories

Path Synopsis
settings module

Jump to

Keyboard shortcuts

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