Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateRandomCommits(day time.Time, numCommits int, messageBase []string) <-chan Commit
- func GetCommitMessageBase() []string
- func GetDaysSinceDateMinusOneYear(givenDate time.Time) <-chan time.Time
- func GetDaysSinceNowMinusOneYear() []time.Time
- func GetRandomNumber(min, max int) int
- func IsNotAField(entry Entry) bool
- func RandomSchedule(min, max int, repo git.Git, filegen utils.FileGenerator)
- func TextSchedule(text string, repo git.Git, filegen utils.FileGenerator) error
- type Commit
- type CommitSchedule
- type Entry
Constants ¶
const ( EMPTY = 0 NUM_WEEK_DAYS = 7 )
const ( COMMIT_MESSAGE_BASE = `` /* 207-byte string literal not displayed */ BASE_SEPARATOR = " " MIN_COMMIT_MESSAGE_LENGTH = 2 MAX_COMMIT_MESSAGE_LENGTH = 8 )
const ( // ScheduleWidth is the width of the schedule ScheduleWidth = 53 // TextRegex is the regular expression used to check the given text TextRegex = "[a-z ]{1,26}" )
Variables ¶
var NOT_A_FIELD = Entry{NumCommits: -1}
Functions ¶
func GenerateRandomCommits ¶
GenerateRandomCommits returns a channel of random commits for a given day. These commits are a random selection of numCommits number of words from the given message base.
func GetCommitMessageBase ¶
func GetCommitMessageBase() []string
func GetDaysSinceDateMinusOneYear ¶
GetDaysSinceDateMinusOneYear returns a channel of days since the given date minus one year. E.g. 01.01.2015 starts at the 01.01.2014.
func GetRandomNumber ¶
GetRandomNumber returns a number in the range of min and max.
func IsNotAField ¶
IsNotAField returns true if the given entry has the same datetime as NOT_A_FIELD.
func RandomSchedule ¶
func RandomSchedule(min, max int, repo git.Git, filegen utils.FileGenerator)
RandomSchedule creates random commits over the past 365/366 days. These commits will be created in the given git repo using the FileGenerator.
func TextSchedule ¶
TextSchedule creates commits over the past 365/366 days to build the given text. These commits will be created in the given git repo using the FileGenerator.
Types ¶
type CommitSchedule ¶
type CommitSchedule [7][53]Entry
func BuildCommitSchedule ¶
func BuildCommitSchedule(days []time.Time) CommitSchedule
BuildCommitSchedule returns an empty CommitSchedule, where all fiels are initialized with EMPTY except those which are not in the range of days. The CommitSchedule is a table of ints.
func (CommitSchedule) String ¶
func (schedule CommitSchedule) String() string
String returns a string representing the CommitSchedule.