locations

package
v0.0.0-...-b5ba5ed Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(location LocationEnum) string

func GetBaseDir

func GetBaseDir(baseDir BaseDirEnum) string

func GetTimestamped

func GetTimestamped(key LocationEnum) string

func ListExpandedPaths

func ListExpandedPaths() map[string]string

ListExpandedPaths returns a machine-readable mapping of the currently configured locations.

func PrettyPaths

func PrettyPaths() string

PrettyPaths returns a nicely formatted, human-readable listing

func Set

func Set(locationName LocationEnum, path string) error

Set overrides a location to the given path, making sure to it points to an absolute path first. Only the special "-" value will be used verbatim.

func SetBaseDir

func SetBaseDir(baseDirName BaseDirEnum, path string) error

Types

type BaseDirEnum

type BaseDirEnum string
const (
	// Overridden by --home flag, $STHOMEDIR, --config flag, or $STCONFDIR
	ConfigBaseDir BaseDirEnum = "config"
	// Overridden by --home flag, $STHOMEDIR, --data flag, or $STDATADIR
	DataBaseDir BaseDirEnum = "data"

	// User's home directory, *not* --home flag
	UserHomeBaseDir BaseDirEnum = "userHome"

	LevelDBDir = "index-v0.14.0.db"
)

type LocationEnum

type LocationEnum string
const (
	ConfigFile    LocationEnum = "config"
	CertFile      LocationEnum = "certFile"
	KeyFile       LocationEnum = "keyFile"
	HTTPSCertFile LocationEnum = "httpsCertFile"
	HTTPSKeyFile  LocationEnum = "httpsKeyFile"
	Database      LocationEnum = "database"
	LogFile       LocationEnum = "logFile"
	PanicLog      LocationEnum = "panicLog"
	AuditLog      LocationEnum = "auditLog"
	GUIAssets     LocationEnum = "guiAssets"
	DefFolder     LocationEnum = "defFolder"
)

Use strings as keys to make printout and serialization of the locations map more meaningful.

Jump to

Keyboard shortcuts

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