Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AnsiReg = regexp.MustCompile("\x1B\\[[0-?]*[ -/]*[@-~]")
Functions ¶
func DateRange ¶
ParseDateRange parses a date range into a start and end date. Dates are expected to be in the YYYY-MM-DD format.
Start and end dates are connected by the range operator ".." where end date is not included in the date range.
ParseDateRange can also parse open-ended ranges, i.e. start.. or ..end are allowed.
Relative date terms (such as "1 week 1 day" or "1w 1d") can be used, too.
func HttpLinks ¶
HttpLinks searches a reader for a http link and returns a copy of the reader and a slice with links.
func MatchCache ¶
Check if a string matches the specified regular expression. The regexp is compiled only once and stored in a cache for future use.
func MsgIDList ¶
MsgIDList parses a list of message identifiers. It returns message identifiers without angle brackets. If the header field is missing, it returns nil.
This can be used on In-Reply-To and References header fields. If the field does not conform to RFC 5322, fall back to greedily parsing a subsequence of the original field.
Types ¶
type RelDate ¶
RelDate is the relative date in the past, e.g. yesterday would be represented as RelDate{0,0,1}.
func RelativeDate ¶
ParseRelativeDate parses a string of relative terms into a DateAdd.
Syntax: N (year|month|week|day) ..
The following are valid inputs: 5weeks1day 5w1d
Adapted from the Go stdlib in src/time/format.go