Documentation ¶
Overview ¶
Package util provides utility functions for use throughout the application. Theses include File/Directory manipulation functions and an exported function for accessing the stored configuration for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ConfigPath is an exported pacakge variable for declaring // the location of the application configuration file. This // can be set using the -c application flag when starting // the application via the command line. ConfigPath = "./_private/app.config" )
Functions ¶
func Config ¶
func Config() config
Config provides an exported facility for accessing the application configuration throughout the application. It returns the current value held by the unexported conf. If blank, it will read from the configuration file located at ConfigPath or the default configuration if ConfigPath does not exist.
func DefaultConfig ¶
func DefaultConfig() config
DefaultConfig returns a set of default configuration values needed to run the application.
func MakeDir ¶
MakeDir creates the directory dir and all parent directories if they do not exist. It will return nil on success or if the directory already exists, otherwise, an error is returned.
Types ¶
type FileReading ¶
type FileReading struct { // Filename is a application relative path of a file. Filename string Info os.FileInfo }
func ReadDir ¶
func ReadDir(dir string) []FileReading
ReadDir reads dir contents recursively. It returns a slice of FileReading on completion.