Documentation ¶
Index ¶
- Constants
- type HistoryEntry
- type Value
- func (v *Value) AddHistoryEntry(timestamp time.Time, uuid string, station string, song string)
- func (v *Value) ClearHistory()
- func (v *Value) DeleteFavorite(uuid string) bool
- func (v *Value) DeleteHistoryEntry(delEntry HistoryEntry)
- func (v *Value) GetVolume() int
- func (v *Value) InsertFavorite(uuid string, idx int) bool
- func (v *Value) IsFavorite(uuid string) bool
- func (v *Value) Save() error
- func (v *Value) SetVolume(value int)
- func (v *Value) String() string
- func (v *Value) ToggleFavorite(uuid string) bool
Constants ¶
View Source
const (
ReqTimeout = 10 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HistoryEntry ¶ added in v0.4.0
type HistoryEntry struct { Uuid string `json:"uuid"` Station string `json:"station"` Song string `json:"song"` Timestamp time.Time `json:"timestamp"` }
func (HistoryEntry) Description ¶ added in v0.4.0
func (e HistoryEntry) Description() string
func (HistoryEntry) FilterValue ¶ added in v0.4.0
func (e HistoryEntry) FilterValue() string
func (HistoryEntry) Title ¶ added in v0.4.0
func (e HistoryEntry) Title() string
type Value ¶
type Value struct { Version string `json:"-"` Debug bool `json:"-"` LogPath string `json:"-"` Favorites []string `json:"favorites,omitempty"` // Ordered station UUID's for user favorites Volume *int `json:"volume,omitempty"` Theme int `json:"theme"` History []HistoryEntry `json:"history,omitempty"` HistorySaveMax *int `json:"historySaveMax,omitempty"` HistoryChan chan []HistoryEntry `json:"-"` AutoplayFavorite string `json:"autoplayFavorite"` IsRunning bool `json:"isRunning"` // contains filtered or unexported fields }
func Load ¶
Load must return a non-nil config Value and an error specifying why it could not read the config file:
- either a default value if no previously saved config is found in the file system
- either the found config Value
func (*Value) AddHistoryEntry ¶ added in v0.4.0
func (*Value) ClearHistory ¶ added in v0.4.0
func (v *Value) ClearHistory()
func (*Value) DeleteFavorite ¶ added in v0.3.1
DeleteFavorite returns true if uuid was removed, false if not
func (*Value) DeleteHistoryEntry ¶ added in v0.4.0
func (v *Value) DeleteHistoryEntry(delEntry HistoryEntry)
func (*Value) InsertFavorite ¶ added in v0.3.1
func (*Value) IsFavorite ¶
func (*Value) ToggleFavorite ¶
ToggleFavorite return true if uuid was added, false if it was removed
Click to show internal directories.
Click to hide internal directories.