reporter

package
v0.0.0-...-25a8327 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reporter

type Reporter struct {

	// ReportDay representing which is the weekly report generation day.
	ReportDay string

	// ReportHour representing which is the weekly report generation time on ReportDay.
	ReportHour int
	// contains filtered or unexported fields
}

Reporter is a reporter to report weekly update on Github Repo in issues. Reports needs to use the repo name to construct the weeklyreport name. Since weekly report generation should be general to all kinds of open source project.

func New

func New(client *gh.Client, day string, hour int) *Reporter

New initializes a brand new reporter.

func (*Reporter) CalculateReviews

func (r *Reporter) CalculateReviews(wr *WeekReport)

CalculateReviews calculates reviews from user since the last week.

func (*Reporter) Run

func (r *Reporter) Run()

Run starts to work on reporting things for repo.

type SimplePR

type SimplePR struct {
	Num     int
	Title   string
	HTMLURL string
}

SimplePR represents

type StatsLastWeek

type StatsLastWeek struct {
	Watch        int
	Star         int
	Fork         int
	Contributors int
}

StatsLastWeek collects repo data from last week.

type WeekReport

type WeekReport struct {

	// time of this weekly report's start time.
	StartDate string

	// time of this weekly report's end time.
	EndDate string

	// Watch defines currently how many github users are watching this repo.
	Watch int

	// Star defines currently how many github users are staring this repo.
	Star int

	// Fork defines currently how many github users have forked this repo.
	Fork int

	// Contributors defines the number of contributors.
	Contributors int

	// NumOfNewIssues is the issues number which are created in the last week.
	NumOfNewIssues int

	// NumOfClosedIssues is the issues number which are closed in the last week.
	NumOfClosedIssues int

	// MergedPR defines how many pull requests have beem merge between time StartDate and EndDate.
	MergedPR map[string][]*SimplePR

	// CountOfPR defines the number of merged pull request.
	CountOfPR int

	// NewContributors defines new contributors between time StartDate and EndDate.
	NewContributors []string

	// PRReviewsByUser defines that all pull request reviews submitted between time StartDate and EndDate.
	// PRReviewsByUser has a type map, the key is User, Value is the number of pull reuqest reviews of single User.
	PRReviewsByUser map[string]int
	// contains filtered or unexported fields
}

WeekReport contains details about elements to construct a report.

func (*WeekReport) String

func (wr *WeekReport) String() string

String returns a string of Week Report

Jump to

Keyboard shortcuts

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