Documentation ¶
Index ¶
- Constants
- func DescribeDuration(duration time.Duration, want *Want) string
- func DurationOf(description string) (time.Duration, error)
- type AntlrAstListener
- func (s *AntlrAstListener) EnterDay(ctx *parser.DayContext)
- func (s *AntlrAstListener) EnterHour(ctx *parser.HourContext)
- func (s *AntlrAstListener) EnterMicrosecond(ctx *parser.MicrosecondContext)
- func (s *AntlrAstListener) EnterMillisecond(ctx *parser.MillisecondContext)
- func (s *AntlrAstListener) EnterMinute(ctx *parser.MinuteContext)
- func (s *AntlrAstListener) EnterMonth(ctx *parser.MonthContext)
- func (s *AntlrAstListener) EnterSecond(ctx *parser.SecondContext)
- func (s *AntlrAstListener) EnterYear(ctx *parser.YearContext)
- func (s *AntlrAstListener) VisitErrorNode(node antlr.ErrorNode)
- func (s *AntlrAstListener) VisitTerminal(node antlr.TerminalNode)
- type Want
Constants ¶
const ( // DayDuration is a duration in one day DayDuration = time.Hour * 24 // MonthDuration is a duration in one month or 31 days MonthDuration = DayDuration * 31 // YearDuraton is a duration in one year YearDuraton = MonthDuration * 12 )
Variables ¶
This section is empty.
Functions ¶
func DescribeDuration ¶
DescribeDuration will produce a time description out of a duration
Types ¶
type AntlrAstListener ¶
type AntlrAstListener struct { parser.BaseJiffyListener // contains filtered or unexported fields }
AntlrAstListener an implementation of the ANTLR4 AST walker
func (*AntlrAstListener) EnterDay ¶
func (s *AntlrAstListener) EnterDay(ctx *parser.DayContext)
EnterDay is called when production day is entered.
func (*AntlrAstListener) EnterHour ¶
func (s *AntlrAstListener) EnterHour(ctx *parser.HourContext)
EnterHour is called when production hour is entered.
func (*AntlrAstListener) EnterMicrosecond ¶
func (s *AntlrAstListener) EnterMicrosecond(ctx *parser.MicrosecondContext)
EnterMicrosecond is called when production microsecond is entered.
func (*AntlrAstListener) EnterMillisecond ¶
func (s *AntlrAstListener) EnterMillisecond(ctx *parser.MillisecondContext)
EnterMillisecond is called when production millisecond is entered.
func (*AntlrAstListener) EnterMinute ¶
func (s *AntlrAstListener) EnterMinute(ctx *parser.MinuteContext)
EnterMinute is called when production minute is entered.
func (*AntlrAstListener) EnterMonth ¶
func (s *AntlrAstListener) EnterMonth(ctx *parser.MonthContext)
EnterMonth is called when production month is entered.
func (*AntlrAstListener) EnterSecond ¶
func (s *AntlrAstListener) EnterSecond(ctx *parser.SecondContext)
EnterSecond is called when production second is entered.
func (*AntlrAstListener) EnterYear ¶
func (s *AntlrAstListener) EnterYear(ctx *parser.YearContext)
EnterYear is called when production year is entered.
func (*AntlrAstListener) VisitErrorNode ¶
func (s *AntlrAstListener) VisitErrorNode(node antlr.ErrorNode)
VisitErrorNode is called when an error node is visited.
func (*AntlrAstListener) VisitTerminal ¶
func (s *AntlrAstListener) VisitTerminal(node antlr.TerminalNode)
VisitTerminal is called when a terminal node is visited.