helpers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 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

View Source
const HttpmsDir = ".httpms"

HttpmsDir is the name of the HTTPMS directory in the user's home directory

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 Copy

func Copy(src, dst string) error

Copy copies a file from src to dst

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() (string, error)

ProjectUserPath returns the directory in which user files should be stored. Creates it is missing. User files are thing such as sqlite files, logfiles and user configs.

func RemovePidFile

func RemovePidFile(PidFile string)

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

func SetLogsFile

func SetLogsFile(logFilePath string) error

SetLogsFile sets the logfile of the server

func SetUpPidFile

func SetUpPidFile(PidFile string)

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