Discover Packages
github.com/bjarneo/cliamp
internal
resume
package
Version:
v1.60.0
Opens a new window with list of versions in this module.
Published: Jul 16, 2026
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package resume persists the last-played track and position so playback
can be resumed on the next launch.
Save writes the resume state to disk. No-ops for empty path or zero/negative
position to avoid overwriting a valid resume file with useless data.
Errors are silently ignored so a failed write never disrupts normal exit.
type State struct {
Path string `json:"path"`
PositionSec int `json:"position_sec"`
Playlist string `json:"playlist,omitempty"`
}
State holds enough information to resume a previous playback session.
Load reads the resume state from disk. Returns a zero State if the file
does not exist or cannot be parsed.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.