Documentation ¶
Index ¶
- Variables
- func CheckError(err error)
- func CleanPath(path string, currentWorkDir string) (absolutePath string, err error)
- func GetParentPath(inPath string) string
- func GetVar(name string, _default string) string
- func IsAbsolute(path string) (abs bool)
- func LtreeToPath(ltree string) (path string, err error)
- func PathToLtree(path string) (ltree string, err error)
Constants ¶
This section is empty.
Variables ¶
var DBHost = GetVar("DB_HOST", "localhost")
DBHost for the production/development database
var DBName = GetVar("DB_NAME", "virtualfs_test")
DBName for the production/development database
var DBPassword = GetVar("DB_PASSWORD", "postgres")
DBPassword for the production/development database
var DBPort = GetVar("DB_PORT", "5432")
DBPort for the production/development database
var DBUrl = GetVar("DATABASE_URL", "")
DBUrl is the complete database url string used to connecth
var DBUser = GetVar("DB_USER", "postgres")
DBUser for the production/development database
var ServerPort = GetVar("PORT", "8080")
ServerPort is the port the server listens on
var Sugar = logger.Sugar()
Sugar is an API for logging from Logger.
Functions ¶
func CheckError ¶
func CheckError(err error)
CheckError panics on an error, ending the program. It takes in the error to panic on if at all.
func GetParentPath ¶
GetParentPath expects an absolute path with no / at the end and return the parent path of that path
func GetVar ¶
GetVar gets an environment variable with name name, and returns its value if its set If not, the function returns the default value
func IsAbsolute ¶
IsAbsolute checks if the provided path is absolute
func LtreeToPath ¶
LtreeToPath returns a fs path representation of an Ltree path
func PathToLtree ¶
PathToLtree returns a Ltree representation of an absolute path
Types ¶
This section is empty.