window

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Window

type Window struct {
	// contains filtered or unexported fields
}

Window is a struct used for managing time windows based on a duration and a minimum number of commits in zero or more repositories.

func New

func New(duration time.Duration, numCommits int, repos repograph.Map) (*Window, error)

New returns a Window instance.

func (*Window) EarliestStart

func (w *Window) EarliestStart() time.Time

EarliestStart returns the earliest start time of any repo's Window.

func (*Window) Start

func (w *Window) Start(repo string) time.Time

Start returns the time.Time at the beginning of the Window.

func (*Window) StartTimesByRepo

func (w *Window) StartTimesByRepo() map[string]time.Time

StartTimesByRepo returns a map of repo URL to start time of that repo's window.

func (*Window) TestCommit

func (w *Window) TestCommit(repo string, c *repograph.Commit) bool

TestCommit determines whether the given commit is in the Window.

func (*Window) TestCommitHash

func (w *Window) TestCommitHash(repo, revision string) (bool, error)

TestCommitHash determines whether the given commit is in the Window.

func (*Window) TestTime

func (w *Window) TestTime(repo string, t time.Time) bool

TestTime determines whether the given Time is in the Window.

func (*Window) Update

func (w *Window) Update() error

Update updates the start time of the Window.

func (*Window) UpdateWithTime

func (w *Window) UpdateWithTime(now time.Time) error

UpdateWithTime updates the start time of the Window, using the given current time.

Jump to

Keyboard shortcuts

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