helpers

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: GPL-3.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "Unknown Version"

This variable gets set by passing -ldflags to the compiler in the Makefile

Functions

func BaseConfigPath

func BaseConfigPath() string

BaseConfigPath returns the root for our config folders.

func CacheDir

func CacheDir() string

CacheDir returns a cache folder to use.

func EnsurePath

func EnsurePath(pathName string) error

EnsurePath ensures the given filesystem path exists, if not it will create it.

func FileExists

func FileExists(pathName string) bool

FileExists checks whether a file or folder exists in the filesystem, will follow symlinks and ensures the target exists too.

func GetHome

func GetHome() string

GetHome returns the given users home folder

func GetXattrInts added in v0.3.3

func GetXattrInts(fileName string, xattrNames []string) (xattrMap map[string]int, err error)

GetXattrInts reads multiple extended attribute values from a filename, one for each extended attribute name passed in the input array, and returns the values in a map so they can be easily correlated with their names.

func InitLoggers

func InitLoggers(level log.Level)

InitLoggers sets the default logger options

func LogPath

func LogPath() string

LogPath returns the path to our logfolder.

func MetadataConfigPath

func MetadataConfigPath() string

MetadataConfigPath returns the config path for the md server

func RandAlphaString

func RandAlphaString(n int) string

func UserCacheDir

func UserCacheDir() (string, error)

UserCacheDir returns the default root directory to use for user-specific cached data. Users should create their own application-specific subdirectory within this one and use that.

On Unix systems, it returns $XDG_CACHE_HOME as specified by https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.cache. On Darwin, it returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%. On Plan 9, it returns $home/lib/cache.

If the location cannot be determined (for example, $HOME is not defined), then it will return an error.

Types

This section is empty.

Directories

Path Synopsis
Package levenshtein is a Go implementation to calculate Levenshtein Distance.
Package levenshtein is a Go implementation to calculate Levenshtein Distance.

Jump to

Keyboard shortcuts

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