knowndirget

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApacheLinuxPath

func ApacheLinuxPath() string

ApacheLinuxPath "/etc/apache/"

func AppDataPath

func AppDataPath() string

AppDataPath Returns path to %AppData% in windows. If directory doesn't exist it still returns the path as a string. Requires further investigation for linux platform: https://stackoverflow.com/questions/1510104/where-to-store-application-data-non-user-specific-on-linux, https://stackoverflow.com/questions/17517131/appdata-in-non-windows

func BinPath

func BinPath() string

BinPath Returns path to bin directory as a string.

func EtcPath

func EtcPath() string

EtcPath

Returns path to etc directory on different platforms.

func FontsPath

func FontsPath() string

FontsPath

Returns path to Fonts directory on different platforms.

func GetNginxLinuxPathWith

func GetNginxLinuxPathWith(directory knowndir.Alias) string

"/etc/nginx/" + directory.Value()

func GetProgramFiles32

func GetProgramFiles32() string

Returns Program Files directory on windows with OS architecture x32

In 32 bit machine program files is just program file, in 64 bit program files is x86

Reference : https://bit.ly/3tX95N6

func GetRoot

func GetRoot() string

func GetServicesPath

func GetServicesPath() string

Returns path to Services directory on different platforms.

func GetSystem64

func GetSystem64() string

Returns path to SysWOW64 path in windows system.

func GetSystemDriversPath

func GetSystemDriversPath() string

Returns path to System drivers directory on different platforms.

func GetSystemPath

func GetSystemPath() string

Returns path to System directory on different platforms.

func GitGlobal

func GitGlobal() string

Returns path to .git. Checks for it on all possible locations. If .git doesn't exist creates it. todo should we use createDirectory to make .git . is it a directory or a file

func GoBin

func GoBin() string

Returns env go bin path

func GoPath

func GoPath() string

Reference: https://stackoverflow.com/a/32650077 Returns env go path : os.Getenv(constants.GoPath) or build.Default.GOPATH

func HostFilePath

func HostFilePath() string

Returns path to hosts on different platforms.

func LocalPath

func LocalPath() string

Returns path to local directory in windows. Otherwise returns Users directory.

func LocalTempPath

func LocalTempPath() string

Returns path to local temp directory. If directory doesn't exist it still returns the path as a string.

func NginxLinuxPath

func NginxLinuxPath() string

"/etc/nginx/"

func ProgramData

func ProgramData() string

func ProgramFiles

func ProgramFiles() string

Returns Program Files directory on windows with OS architecture x32

In 32 bit machine program files is just program file, in 64 bit program files is x86

Reference : https://bit.ly/3tX95N

func ProgramFiles64

func ProgramFiles64() string

ProgramFiles64

Returns Program Files directory on windows with OS architecture x64

Program files for x64 bit is always `Program Files`, one cannot install x64 bit application on a x32 bit machine.

Reference : https://bit.ly/3tX95N6

func SSHGlobal

func SSHGlobal() string

Returns .ssh path as string.

func System32

func System32() string

Returns path to System32 path in windows system.

func TempDirectory

func TempDirectory() string

func TempPath

func TempPath() string

Returns temp directory. After checking in on all possible locations, if directory doesn't exist, then doesnt create the directory and returns the path as a string.

func UnixRoot

func UnixRoot() string

Returns unix system root as a string

func UserDocumentsPath

func UserDocumentsPath() string

Returns documents directory path as a string.

func UserDownloadsPath

func UserDownloadsPath() string

Returns downloads directory path as a string.

func UserMusicPath

func UserMusicPath() string

Returns Music directory path as a string.

func UserPath

func UserPath() string

Returns home directory. Panics if directory doesn't exist.

func UserPicturesPath

func UserPicturesPath() string

Returns Pictures directory path as a string.

func UserRoamingPath

func UserRoamingPath() string

Returns Roaming directory path as a string.

func UserVideosPath

func UserVideosPath() string

Returns Videos directory path as a string.

func UsersPath

func UsersPath() string

Returns path to Users directory

func WidowsDirectory

func WidowsDirectory() string

WidowsDirectory

Returns windows directory path.

func WindowsRoot

func WindowsRoot() string

Returns Windows root as a string

Drive letter + colon, from Windows 7 onwards it is c:\ constant. However to be precise it gets windir and gets the dir symbol Returns `c:\`

Reference : https://play.golang.org/p/ZtXTSczrevD

Types

This section is empty.

Jump to

Keyboard shortcuts

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