Skip to content

Commit

Permalink
periodic: document start and end and add constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hnnsgstfssn committed Mar 22, 2023
1 parent e7167f6 commit 1b05c69
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions sdks/go/pkg/beam/transforms/periodic/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,22 @@ func init() {
// timestamped elements at an interval.
type SequenceDefinition struct {
Interval time.Duration
Start int64
End int64

// Start is the number of milliseconds since the Unix epoch.
Start int64

// End is the number of milliseconds since the Unix epoch.
End int64
}

// NewSequenceDefinition creates a new [SequenceDefinition] from a start and
// end [time.Time] along with its interval [time.Duration].
func NewSequenceDefinition(start, end time.Time, interval time.Duration) SequenceDefinition {
return SequenceDefinition{
Start: start.UnixMilli(),
End: end.UnixMilli(),
Interval: interval,
}
}

type sequenceGenDoFn struct{}
Expand Down

0 comments on commit 1b05c69

Please sign in to comment.