globals

package
v0.0.0-...-843c29a Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package globals exists because go does not suppot circular dependencies, therefore this is it's own package.

Index

Constants

This section is empty.

Variables

View Source
var Root string

Root is the root folder where the player is initialized

Functions

func Contains

func Contains(arr []string, str string) bool

Contains is helper function to check if an array cointains a specific string. Often used in correlation with GetSupportedFormats().

func GetSupportedFormats

func GetSupportedFormats() []string

GetSupportedFormats returns an array of strings with the file extentions that are supported by the program.

Types

type ConfigFile

type ConfigFile struct {
	Mode     string `json:"mode"`
	Database struct {
		User     string `json:"user"`
		Password string `json:"password"`
		Database string `json:"database"`
		Host     string `json:"host"`
		Port     int    `json:"port"`
	} `json:"database"`
	Highlight    string `json:"highlight"`
	Quiet        bool   `json:"quiet"`
	Logging      bool   `json:"logging"`
	DisableSound bool   `json:"disableSound"`
	Webserver    struct {
		Enable bool `json:"enable"`
		Port   int  `json:"port"`
	} `json:"webserver"`
	Webinterface struct {
		Enable bool `json:"enable"`
		Port   int  `json:"port"`
	} `json:"webinterface"`
	Serial struct {
		Enable bool   `json:"enable"`
		Port   string `json:"port"`
	} `json:"serial"`
}

ConfigFile is a struct that holds all database connection info.

var Config ConfigFile

Config is the variable that holder the config file

type Folder

type Folder struct {
	ID       int
	Path     string
	ParentID int
}

Folder is a struct that holds all folder info, this correlates directly to what is in the database. It is also used in filesystem mode but only to hold the path.

type Track

type Track struct {
	ID       int
	Path     string
	FolderID int
	Title    sql.NullString
	Album    sql.NullString
	Artist   sql.NullString
	Genre    sql.NullString
	Year     sql.NullInt64
	Plays    int
	Error    bool
}

Track is a struct that holds all folder info, this correlates directly to what is in the database. It is also used in filesystem mode but only to hold the meta tags.

Jump to

Keyboard shortcuts

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