Documentation ¶
Overview ¶
Package rateexpr provides logic for parsing and scheduling rate expressions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateExpression ¶
type RateExpression struct {
// contains filtered or unexported fields
}
A Expression represents a specific rate time expression as defined at <http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#RateExpressions>
func Parse ¶
func Parse(rateLine string) (*RateExpression, error)
Parse returns a new RateExpression pointer. An error is returned if a malformed rate expression is supplied. See <http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#RateExpressions> for documentation about what is a well-formed rate expression from this library's point of view.
func (*RateExpression) Next ¶
func (expr *RateExpression) Next(fromTime time.Time) time.Time
Next returns the closest time instant immediately following `fromTime` which matches the rate expression `expr`.
The `time.Location` of the returned time instant is the same as that of `fromTime`.
The zero value of time.Time is returned if no matching time instant exists or if a `fromTime` is itself a zero value.