x

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildVersion = "master"
	BuildTime    = "undefined"
	BuildGitHash = "undefined"
)

Functions

func AppConfigDir added in v0.0.45

func AppConfigDir(l *logrusx.Logger) string

AppConfigDir returns the directory where to store user's config.

If XDG_CONFIG_HOME is set, it returns: $XDG_CONFIG_HOME/ory. Otherwise, os.UserConfigDir() is used; if successful, it appends "ory" (Windows & Mac) or "ory" (every other OS) to the path. If it returns an error, the fallback path "./ory" is returned.

The config directory is not guaranteed to be different from AppDataDir().

Unlike os.UserConfigDir(), this function prefers the XDG_CONFIG_HOME env var on all platforms, not just Unix.

Ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

func AppDataDir added in v0.0.45

func AppDataDir() string

AppDataDir returns a directory path that is suitable for storing application data on disk. It uses the environment for finding the best place to store data, and appends a "ory" or "ory" (depending on OS and environment) subdirectory.

For a base directory path: If XDG_DATA_HOME is set, it returns: $XDG_DATA_HOME/ory; otherwise, on Windows it returns: %AppData%/ory, on Mac: $HOME/Library/Application Support/ory, on Plan9: $home/lib/ory, on Android: $HOME/ory, and on everything else: $HOME/.local/share/ory.

If a data directory cannot be determined, it returns "./ory" (this is not ideal, and the environment should be fixed).

The data directory is not guaranteed to be different from AppConfigDir().

Ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Types

This section is empty.

Jump to

Keyboard shortcuts

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