Documentation ¶
Index ¶
- func AddDays(d time.Time, n int) time.Time
- func AllFilesUnderDir(dir string) []string
- func Append(filename string, label string) *os.File
- func CopyFile(fromPath, toPath, label string)
- func Create(filename string, label string) *os.File
- func DaysBetween(bgn time.Time, end time.Time) int
- func ExecPath() string
- func F32toa(f float32) string
- func F64toa(f float64) string
- func FileExists(filename string) bool
- func FileLen(filename string) int64
- func FileMode(filename string) (os.FileMode, error)
- func HasS(list []string, str string) bool
- func Heading(label string, dashes int) string
- func Hostname() string
- func InTimeRange(t time.Time, bgn time.Time, end time.Time) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func MakeDate(yyyymmdd int) time.Time
- func MakeDateI(yyyymmdd int) time.Time
- func MakeDateList(bgn time.Time, end time.Time) []time.Time
- func MakeDateS(s string) time.Time
- func MkDir(dir string, label string)
- func NowDate() time.Time
- func Open(filename string) *os.File
- func ParseFloat64(str string) float64
- func ParseUint32(str string) uint32
- func ReadFile(filename string, label string) string
- func ReadYAML(filename string, config interface{})
- func Separator(length int) string
- func SideBySide(a string, b string, divider string) string
- func SortI(s []int)
- func SortS(s []string)
- func StackTrace(depth int) string
- func StripColors(s string) string
- func SubDays(d time.Time, n int) time.Time
- func U32toa(u uint32) string
- func Username() string
- func WriteFile(filename, body, label string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDays ¶
AddDays adds the given number of days to the given date. The number of days can be negative.
func AllFilesUnderDir ¶
AllFilesUnderDir returns a list of all filenames that exist under the supplied directory. If the supplied directory does not exist then it returns an empty list.
func CopyFile ¶
func CopyFile(fromPath, toPath, label string)
CopyFile copies a given file. alert.Exit on failure (via WriteFile)
func DaysBetween ¶
DaysBetween returns the number of days between the two dates. Remember that the difference between a date and itself is zero.
func ExecPath ¶
func ExecPath() string
ExecPath returns a string containing the full executable path.
func F32toa ¶
F32toa converts a float32 into a string. This is simply a convenience wrapper around `strconv.FormatFloat`.
func F64toa ¶
F64toa converts a float64 into a string. This is simply a convenience wrapper around `strconv.FormatFloat`.
func FileExists ¶
FileExists return true of the supplied filename exists
func Hostname ¶
func Hostname() string
Hostname returns a string containing the hostname. Returns the value "unknown_host" on failure
func InTimeRange ¶
InTimeRange returns true if the first time is between the second and third times inclusive
func MakeDate ¶
MakeDate converts a date in literal-integer format (i.e. 2015-06-01 is represented by the integer 20150601) to a time.Time value in the local timezone.
func MakeDateI ¶
MakeDateI converts a date in literal-integer format (i.e. 2015-06-01 is represented by the integer 20150601) to a time.Time value in the local timezone.
func MakeDateList ¶
MakeDateList returns a list of consecutive dates starting and ending on the given dates (inclusive)
func MakeDateS ¶
MakeDateS converts a date from string formats "2015-06-01" and "20150601" to a time.Time value. The time will be midnight UTC.
func ParseFloat64 ¶
ParseFloat64 parses a string and returns a float64. On failure it displays an error message and calls exit.
func ParseUint32 ¶
ParseUint32 parses a string and returns a uint32. On failure it displays an error message and calls exit.
func ReadYAML ¶
func ReadYAML(filename string, config interface{})
ReadYAML reads a YAML file into an arbitrary structure.
func SideBySide ¶
SideBySide takes two (multi-line) strings and returns a string that displays them side by side:
Apple Pear Banana Grapefruit Canteloupe
They do not have to have the same number of lines
func StackTrace ¶
StackTrace returns a string containing stack-trace information up to the supplied depth. Supplying a depth of zero results in a full stack-trace.
func StripColors ¶
StripColors returns a string by removing color-coding characters from the supplied string
func SubDays ¶
SubDays subtracts the given number of days to the given date. The number of days can be negative.
Types ¶
This section is empty.