ghmon

package
v0.0.0-...-82c79d7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAPIRequestForArray

func MakeAPIRequestForArray(apiParams string) []interface{}

Types

type Blink1

type Blink1 struct {
}

func (*Blink1) BlinkRed

func (blink1 *Blink1) BlinkRed()

type Configuration

type Configuration struct {
	OwnQuery        string        `split_words:"true"`
	ReviewQuery     string        `split_words:"true"`
	RefreshInterval time.Duration `default:"15m" split_words:"true"`
}

type Event

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

type EventType

type EventType int
const (
	Status EventType = iota
	PullRequestRefreshStarted
	PullRequestsUpdates
	PullRequestUpdated
	PullRequestDeleted
	PullRequestRefreshFinished
)

type GHMon

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

func NewGHMon

func NewGHMon() *GHMon

func (*GHMon) ConvertPullRequestReviewStateToString

func (ghm *GHMon) ConvertPullRequestReviewStateToString(pullRequestReviewStatus PullRequestReviewStatus) string

func (*GHMon) ConvertToPullRequestReviewState

func (ghm *GHMon) ConvertToPullRequestReviewState(pullRequestReviewStatusString string) PullRequestReviewStatus

func (*GHMon) Events

func (ghm *GHMon) Events() <-chan Event

func (*GHMon) HasValidSetup

func (ghm *GHMon) HasValidSetup() bool

func (*GHMon) Initialize

func (ghm *GHMon) Initialize()

func (*GHMon) IsLoggedIn

func (ghm *GHMon) IsLoggedIn() bool

func (*GHMon) Logger

func (ghm *GHMon) Logger() *log.Logger

func (*GHMon) PurgeDeletedPullRequests

func (ghm *GHMon) PurgeDeletedPullRequests() int

func (*GHMon) RetrievePullRequests

func (ghm *GHMon) RetrievePullRequests()

func (*GHMon) RetrieveUser

func (ghm *GHMon) RetrieveUser() *User

func (*GHMon) UpdateSeen

func (ghm *GHMon) UpdateSeen(pullRequestWrapper *PullRequestWrapper, seen bool)

type LoggerConsole

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

type PullRequest

type PullRequest struct {
	Id                           uint32
	Repo                         *Repo
	Creator                      *User
	Title                        string
	Body                         string
	HtmlURL                      *url.URL
	PullRequestURL               *url.URL
	CreatedAt                    time.Time
	UpdatedAt                    time.Time
	PullRequestReviewsByUser     map[uint32][]*PullRequestReview
	PullRequestReviewsByPriority [][]*PullRequestReview
	PullRequestType              PullRequestType
	Lock                         sync.Mutex
}

type PullRequestEntry

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

type PullRequestGroup

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

type PullRequestReview

type PullRequestReview struct {
	User        *User
	Status      PullRequestReviewStatus
	SubmittedAt time.Time
	Score       float32
}

type PullRequestReviewStatus

type PullRequestReviewStatus int
const (
	PullRequestReviewStatusUnknown PullRequestReviewStatus = iota
	PullRequestReviewStatusApproved
	PullRequestReviewStatusCommented
	PullRequestReviewStatusChangesRequested
	PullRequestReviewStatusPending
	PullRequestReviewStatusRequested
	PullRequestReviewStatusDismissed
)

type PullRequestScore

type PullRequestScore struct {
	Total            float32
	Seen             bool
	AgeSec           uint32
	Approvals        uint
	ApprovedByMe     bool
	Comments         uint
	Dismissed        uint
	ChangesRequested uint
	NumReviewers     uint
	IsMyPullRequest  bool
}

type PullRequestType

type PullRequestType int
const (
	Own PullRequestType = iota
	Reviewer
)

type PullRequestWrapper

type PullRequestWrapper struct {
	Id              uint32
	PullRequestType PullRequestType
	FirstSeen       time.Time
	Seen            bool
	/* Score is between 0 and 100 (higher score, more critical) */
	Score       PullRequestScore
	PullRequest *PullRequest
	Deleted     bool
}

type PullRequestsUpdatesEvent

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

type Repo

type Repo struct {
	Id          uint32
	Name        string
	FullName    string
	Description string
	Url         *url.URL
}

type RepositoryConfiguration

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

type ScoreCalculator

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

func (*ScoreCalculator) CalculateScore

func (scoreCalculator *ScoreCalculator) CalculateScore(user *User, pullRequestWrapper *PullRequestWrapper) PullRequestScore

func (*ScoreCalculator) CalculateTotalScore

func (scoreCalculator *ScoreCalculator) CalculateTotalScore(user *User, pullRequestWrapper *PullRequestWrapper) float32

func (*ScoreCalculator) ExtractMostImportantFirst

func (scoreCalculator *ScoreCalculator) ExtractMostImportantFirst(pullRequestReviews []*PullRequestReview) *PullRequestReview

func (*ScoreCalculator) PullRequestReviewStatusToInt

func (scoreCalculator *ScoreCalculator) PullRequestReviewStatusToInt(status PullRequestReviewStatus) int

func (*ScoreCalculator) RankPullRequestReview

func (scoreCalculator *ScoreCalculator) RankPullRequestReview(left *PullRequestReview, right *PullRequestReview) int

type Storage

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

func (*Storage) DeletePullRequestWrapper

func (ghmStorage *Storage) DeletePullRequestWrapper(id uint32)

func (*Storage) LoadPullRequestWrapper

func (ghmStorage *Storage) LoadPullRequestWrapper(id uint32) chan *PullRequestWrapper

func (*Storage) StorePullRequestWrapper

func (ghmStorage *Storage) StorePullRequestWrapper(pullRequestWrapper *PullRequestWrapper)

type UI

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

func NewGHMonUI

func NewGHMonUI(ghm *GHMon) *UI

func (*UI) EventLoop

func (ghui *UI) EventLoop()

type User

type User struct {
	Id       uint32
	Username string
}

type UserConfiguration

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

Jump to

Keyboard shortcuts

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