// DATE-MDAY = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year func parseDay(buff []byte, cursor *int, l int) (int, error) { // XXX : this is a relaxed constraint // XXX : we do not check if valid regarding February or leap years // XXX : we only checks that day is in range [01 -> 31] // XXX : in other words this function will not rant if you provide Feb 31th return syslogparser.Parse2Digits(buff, cursor, l, 1, 31, ErrDayInvalid) }
// TIME-SECOND = 2DIGIT ; 00-59 func parseSecond(buff []byte, cursor *int, l int) (int, error) { return syslogparser.Parse2Digits(buff, cursor, l, 0, 59, ErrSecondInvalid) }
// TIME-MINUTE = 2DIGIT ; 00-59 func parseMinute(buff []byte, cursor *int, l int) (int, error) { return syslogparser.Parse2Digits(buff, cursor, l, 0, 59, ErrMinuteInvalid) }
// TIME-HOUR = 2DIGIT ; 00-23 func parseHour(buff []byte, cursor *int, l int) (int, error) { return syslogparser.Parse2Digits(buff, cursor, l, 0, 23, ErrHourInvalid) }
// DATE-MONTH = 2DIGIT ; 01-12 func parseMonth(buff []byte, cursor *int, l int) (int, error) { return syslogparser.Parse2Digits(buff, cursor, l, 1, 12, ErrMonthInvalid) }