rateexpr

package
v0.0.0-...-f6ab670 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL