Documentation ¶
Overview ¶
Package helpers contains few helpers functions which are used throughout the project.
Index ¶
- func AbsolutePath(path, relativeRoot string) string
- func GuessTrackNumber(trackFilePath string) int64
- func ProjectRoot() (rootPath string, err error)
- func ProjectUserPath(appfs afero.Fs) (string, error)
- func RemovePidFile(appfs afero.Fs, PidFile string)
- func SetLogsFile(appfs afero.Fs, logFilePath string) error
- func SetUpPidFile(appfs afero.Fs, PidFile string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsolutePath ¶
AbsolutePath returns absolute path. If path is already absolute leave it be. If not join it with relativeRoot
func GuessTrackNumber ¶ added in v1.0.4
GuessTrackNumber will use the file name of a particular media file to decide what its track number should be. This may be useful when the media file is missing this information in the meta data but the order is clearly marked in the file name. The function tries a few examples found by scanning real files found in the wild.
func ProjectRoot ¶
ProjectRoot returns the source root directory. This function is useful only for tests which seek to find test files relative to the root of the repository.
func ProjectUserPath ¶
ProjectUserPath returns the directory in which user files should be stored. Creates it if missing. User files are things such as sqlite files, logfiles and user configs.
func RemovePidFile ¶
RemovePidFile just removes the pidFile. The argument should be file path.
func SetLogsFile ¶
SetLogsFile sets the logfile of the server
Types ¶
This section is empty.