Documentation ¶
Index ¶
- Constants
- func AssetPath(assetName string) (string, error)
- func ExternalIPAddress() (string, error)
- func FullDateString() string
- func FullDateStringSafe() string
- func ReadLines(path string) ([]string, error)
- func SysAssetPath(assetName string) (string, error)
- func TimeStampFileName(fileBaseName string, fileExtension string) string
Constants ¶
const ASSET_ROOT_DIR = "assets"
the root asset directory where all the external files used are stored
Variables ¶
This section is empty.
Functions ¶
func AssetPath ¶
AssetPath will return the relative path to the file represented by assetName otherwise it will return an error if the file doesn't exist.
func ExternalIPAddress ¶
ExternalIPAddress will get this current computer's external IP address. credit to: https://gist.github.com/jniltinho/9788121
func FullDateString ¶
func FullDateString() string
FullDateString will return the current time formatted as a string.
func FullDateStringSafe ¶
func FullDateStringSafe() string
FullDateStringSafe returns the current time as a string with only file-name safe characters. Used to quickly and easily generate unique file names based off of the current system time.
func ReadLines ¶
ReadLines reads in a file by path and returns a slice of strings credit to: https://stackoverflow.com/a/18479916/584947
func SysAssetPath ¶
SysAssetPath will return the relative path to the file represented by assetName but also add in the GOOS after the filename and before the extension. This allows loading system-specific files with one command instead of a complicated switch statement every time. For instance if your GOOS == "linux" then you can open "config_linux.json" by just asking for "config.json". This is extremely powerful and a core component of loading system-specific shell commands based on the current GOOS.
func TimeStampFileName ¶
TimeStampFileName will generate a string to be used to uniquely name and identify a new file. The characters used in the file name are guaranteed to be safe for a file. The given fileBaseName will be used to append to the beginning of the file name to give some control over the file name.
Types ¶
This section is empty.