Documentation ¶
Overview ¶
Package client continues functionality shared across client binaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig loads a JSON-marshaled Config from the file at p and updates dst.
Types ¶
type Config ¶
type Config struct { // ServerURL contains the App Engine server URL. ServerURL string `json:"serverUrl"` // Username contains an HTTP basic auth username. Username string `json:"username"` // Password contains an HTTP basic auth password. Password string `json:"password"` // CoverDir is the base directory containing cover art. CoverDir string `json:"coverDir"` // MusicDir is the base directory containing song files. MusicDir string `json:"musicDir"` // MetadataDir is the base directory containing JSON files that override song metadata. // $HOME/.nup/metadata will be used by default. MetadataDir string `json:"metadataDir"` // LastUpdateInfoFile is the path to a JSON file storing info about the last update. // The file will be created if it does not already exist. // $HOME/.nup/last_update_info.json will be used by default. LastUpdateInfoFile string `json:"lastUpdateInfoFile"` // ComputeGain indicates whether the mp3gain program should be used to compute per-song // and per-album gain information so that volume can be normalized during playback. ComputeGain bool `json:"computeGain"` // ArtistRewrites maps from original ID3 tag artist names to replacement names that should // be used for updates. This can be used to fix incorrectly-tagged files without needing to // reupload them. ArtistRewrites map[string]string `json:"artistRewrites"` // AlbumIDRewrites maps from original ID3 tag album IDs (i.e. MusicBrainz UUIDs) to // replacement IDs that should be used for updates. If the album name ends with the suffix // " (disc [number])", the suffix will be removed and the song's disc number will be set // accordingly. This can be used to fix split releases without needing to retag and reupload // them. AlbumIDRewrites map[string]string `json:"albumIdRewrites"` }
Config holds configuration details for the nup client executable.
type TaskCache ¶
type TaskCache struct {
// contains filtered or unexported fields
}
TaskCache runs tasks that each produce one or more key-value pairs.
func NewTaskCache ¶
NewTaskCache returns a TaskCache that will run up to maxTasks simultaneous tasks.
func (*TaskCache) Get ¶
Get returns the item with the supplied key from the cache. If the item is not already in the cache, task will be executed (if another task with the same task key is not already running) and the resulting items will be saved to the cache.
func (*TaskCache) GetIfExists ¶
GetIfExists returns the item with the supplied key only if it's already been computed.