utils

package
v0.0.0-...-1edb5c9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBHost = GetVar("DB_HOST", "localhost")

DBHost for the production/development database

View Source
var DBName = GetVar("DB_NAME", "virtualfs_test")

DBName for the production/development database

View Source
var DBPassword = GetVar("DB_PASSWORD", "postgres")

DBPassword for the production/development database

View Source
var DBPort = GetVar("DB_PORT", "5432")

DBPort for the production/development database

View Source
var DBUrl = GetVar("DATABASE_URL", "")

DBUrl is the complete database url string used to connecth

View Source
var DBUser = GetVar("DB_USER", "postgres")

DBUser for the production/development database

View Source
var ServerPort = GetVar("PORT", "8080")

ServerPort is the port the server listens on

View Source
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 CleanPath

func CleanPath(path string, currentWorkDir string) (absolutePath string, err error)

CleanPath gives us a clean path from a potentially relative path

func GetParentPath

func GetParentPath(inPath string) string

GetParentPath expects an absolute path with no / at the end and return the parent path of that path

func GetVar

func GetVar(name string, _default string) string

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

func IsAbsolute(path string) (abs bool)

IsAbsolute checks if the provided path is absolute

func LtreeToPath

func LtreeToPath(ltree string) (path string, err error)

LtreeToPath returns a fs path representation of an Ltree path

func PathToLtree

func PathToLtree(path string) (ltree string, err error)

PathToLtree returns a Ltree representation of an absolute path

Types

This section is empty.

Jump to

Keyboard shortcuts

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