helpers

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package helpers contains few helpers functions which are used throughout the project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(path, relativeRoot string) string

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

func GuessTrackNumber(trackFilePath string) int64

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

func ProjectRoot() (rootPath string, err error)

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

func ProjectUserPath(appfs afero.Fs) (string, error)

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

func RemovePidFile(appfs afero.Fs, PidFile string)

RemovePidFile just removes the pidFile. The argument should be file path.

func SetLogsFile

func SetLogsFile(appfs afero.Fs, logFilePath string) error

SetLogsFile sets the logfile of the server

func SetUpPidFile

func SetUpPidFile(appfs afero.Fs, PidFile string) error

SetUpPidFile will create the pidfile and it will contain the processid of the current process

Types

This section is empty.

Jump to

Keyboard shortcuts

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