Documentation ¶
Overview ¶
Copyright David Thorpe 2015-2017 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc
Copyright David Thorpe 2015-2016 All Rights Reserved Please see file LICENSE for information on distribution, etc
Index ¶
- Variables
- func DeleteFileIfExists(path string) error
- func ParseDatePeriod(value string) (time.Time, time.Time, error)
- func ParseDuration(value string, notnull bool) (time.Duration, error)
- func ParseTime(value string, notnull bool) (time.Time, error)
- func ResolvePath(path string, relpath string) (string, bool)
- func UppercaseFirstLetter(src string) string
- func UserDir() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Year = regexp.MustCompile("^\\s*(\\d{4})\\s*$") // YYYY YearMonth = regexp.MustCompile("^\\s*(\\d{4})-(\\d{1,2})\\s*$") // YYYY-MM MonthYear = regexp.MustCompile("^\\s*(\\d{1,2})-(\\d{4})\\s*$") // MM-YYYY NullTime = time.Time{} )
View Source
var ( Empty = regexp.MustCompile("^\\s*$") TimeNow = regexp.MustCompile("^\\s*(NOW)\\s*$") InHours = regexp.MustCompile("^\\s*(IN)\\s+(\\d+)\\s+(H|HR|HOUR|HRS|HOURS)\\s*$") InMinutes = regexp.MustCompile("^\\s*(IN)\\s+(\\d+)\\s+(M|MIN|MINUTE|MINS|MINUTES)\\s*$") InDays = regexp.MustCompile("^\\s*(IN)\\s+(\\d+)\\s+(D|DAY|DAYS)\\s*$") YYYYMMDD = regexp.MustCompile("^\\s*(\\d{4})-(\\d{2})-(\\d{2})\\s*$") ISO = time.RFC3339Nano )
Functions ¶
func DeleteFileIfExists ¶
func ParseTime ¶
Parse english-language dates and times. Returns the time, a boolean value indicating if the time-part is significant, and an error if the time could not be parsed, or nil The 'notnull' boolean flag can be used to allow empty string, in which case time.Time{} is returned
func ResolvePath ¶
Make absolute path from a path, relative to another Returns the absolute path and a boolean value which indicates if the returned path exists or not
func UppercaseFirstLetter ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.