modules

package
v0.0.0-...-690d975 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package modules implements the different kinds of widgets that are used by the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterWidget

func FilterWidget(label string, options []string, filterer Filterer) *tview.DropDown

FilterWidget returns a new drop down widget with specified label and options. It calls the Filter method of the Filterer interface to filter the data whenever an option is selected.

func PageSizeWidget

func PageSizeWidget(pageSizer PageSizer) *tview.DropDown

PageSizeWidget returns a new drop down widget with different page size options.

Types

type Avatar

type Avatar struct {
	*views.TextWidget
}

Avatar represents the github user's avatar.

func AvatarWidget

func AvatarWidget(app *tview.Application, config config.Config) *Avatar

AvatarWidget returns an instance of an avatar widget.

func (*Avatar) Refresh

func (a *Avatar) Refresh()

Refresh refreshes the avatar widget.

type Contributions

type Contributions struct {
	*views.Base
	*tview.TreeView
	// contains filtered or unexported fields
}

Contributions represents the github contributions of a user.

func ContributionsWidget

func ContributionsWidget(app *tview.Application, config config.Config) *Contributions

ContributionsWidget returns a new instance of contribution widget.

func (*Contributions) Refresh

func (c *Contributions) Refresh()

Refresh refreshes the contributions widget.

type ContributionsCollection

type ContributionsCollection struct {
	HasAnyContributions                                bool
	HasActivityInThePast                               bool
	TotalCommitContributions                           int
	TotalRepositoriesWithContributedCommits            int
	TotalRepositoryContributions                       int
	TotalPullRequestContributions                      int
	TotalRepositoriesWithContributedPullRequests       int
	TotalPullRequestReviewContributions                int
	TotalRepositoriesWithContributedPullRequestReviews int
	TotalIssueContributions                            int
	TotalRepositoriesWithContributedIssues             int

	JoinedGitHubContribution *struct {
		OccurredAt *time.Time
	}

	CommitContributionsByRepository []struct {
		Repository struct {
			NameWithOwner string
		}
		Contributions struct {
			TotalCount int
		}
	}

	FirstRepositoryContribution *struct {
		CreatedRepositoryContribution struct {
			Repository struct {
				Name            string
				PrimaryLanguage *struct {
					Name  string
					Color string
				}
			}
			OccurredAt *time.Time
		} `graphql:"... on CreatedRepositoryContribution"`
	}

	RepositoryContributions struct {
		TotalCount int
		Nodes      []struct {
			OccurredAt *time.Time
			Repository struct {
				NameWithOwner   string
				PrimaryLanguage *struct {
					Name  string
					Color string
				}
			}
		}
	} `graphql:"repositoryContributions(first: 25, excludeFirst: true)"`

	FirstPullRequestContribution *struct {
		CreatedPullRequestContribution struct {
			PullRequest struct {
				Title      string
				State      string
				Repository struct {
					NameWithOwner string
				}
			}
			OccurredAt *time.Time
		} `graphql:"... on CreatedPullRequestContribution"`
	}

	PopularPullRequestContribution *struct {
		OccurredAt  *time.Time
		PullRequest struct {
			Title      string
			State      string
			Repository struct {
				NameWithOwner string
			}
			Comments struct {
				TotalCount int
			}
		}
	}

	PullRequestContributionsByRepository []struct {
		Contributions struct {
			TotalCount int
			Nodes      []struct {
				OccurredAt  *time.Time
				PullRequest struct {
					Title    string
					State    string
					Comments struct {
						TotalCount int
					}
				}
			}
		} `graphql:"contributions(first: 25)"`
		Repository struct {
			NameWithOwner string
		}
	} `graphql:"pullRequestContributionsByRepository(excludeFirst: true, excludePopular: true)"`

	PullRequestReviewContributionsByRepository []struct {
		Contributions struct {
			TotalCount int
			Nodes      []struct {
				OccurredAt  *time.Time
				PullRequest struct {
					Title string
				}
				PullRequestReview struct {
					State string
				}
			}
		} `graphql:"contributions(first: 25)"`
		Repository struct {
			NameWithOwner string
		}
	}

	FirstIssueContribution *struct {
		CreatedIssueContribution struct {
			Issue struct {
				Title      string
				State      string
				Repository struct {
					NameWithOwner string
				}
			}
			OccurredAt *time.Time
		} `graphql:"... on CreatedIssueContribution"`
	}

	PopularIssueContribution *struct {
		OccurredAt *time.Time
		Issue      struct {
			Title      string
			State      string
			Repository struct {
				NameWithOwner string
			}
			Comments struct {
				TotalCount int
			}
		}
	}

	IssueContributionsByRepository []struct {
		Contributions struct {
			Nodes []struct {
				Issue struct {
					Title    string
					State    string
					Comments struct {
						TotalCount int
					}
				}
				OccurredAt *time.Time
			}
			TotalCount int
		} `graphql:"contributions (first: 25)"`
		Repository struct {
			NameWithOwner string
		}
	} `graphql:"issueContributionsByRepository(excludeFirst: true, excludePopular: true)"`
}

ContributionsCollection represents the github contributions collection.

type Feeds

type Feeds struct {
	*views.TextWidget
	// contains filtered or unexported fields
}

Feeds represents the github feeds.

func FeedsWidget

func FeedsWidget(app *tview.Application, config config.Config) *Feeds

FeedsWidget returns a new instance of feeds widget.

func (*Feeds) Refresh

func (f *Feeds) Refresh()

Refresh refreshes the feeds widget.

type Filterer

type Filterer interface {
	Filter(string)
}

Filterer provides a method which can filter the data according to the provided option.

type Notifications

type Notifications struct {
	*views.TextWidget
	*github.NotificationListOptions
	*github.Response
}

Notifications represents the github notifications.

func NotificationsWidget

func NotificationsWidget(app *tview.Application, config config.Config) *Notifications

NotificationsWidget returns a new instance of notifications widget.

func (*Notifications) First

func (n *Notifications) First()

First navigates to the first page of the notifications.

func (*Notifications) Last

func (n *Notifications) Last()

Last navigates to the last page of the notifications.

func (*Notifications) Next

func (n *Notifications) Next()

Next navigates to the next page of the notifications.

func (*Notifications) Prev

func (n *Notifications) Prev()

Prev navigates to the previous page of the notifications.

func (*Notifications) Refresh

func (n *Notifications) Refresh()

Refresh refreshes the notifications widget.

type PageSizer

type PageSizer interface {
	SetPageSize(pageSize int)
}

PageSizer provides a method to set the page size for the paginated data.

type Pagination

type Pagination struct {
	First *tview.Button
	Last  *tview.Button
	Prev  *tview.Button
	Next  *tview.Button
}

Pagination represents the navigation buttons used in the application.

func PaginationWidget

func PaginationWidget(paginator Paginator) *Pagination

PaginationWidget returns a new pagination widget that contains buttons to navigate to first, last, previous and next pages.

type Paginator

type Paginator interface {
	First()
	Last()
	Prev()
	Next()
}

Paginator provides methods to navigate through the paginated data.

type Pinned

type Pinned struct {
	*views.PinnedView
	// contains filtered or unexported fields
}

Pinned represents a pinned github repo or gist.

func PinnedWidget

func PinnedWidget(app *tview.Application) *Pinned

PinnedWidget returns an instance of pinned widget.

func (*Pinned) Refresh

func (p *Pinned) Refresh()

Refresh refreshes the pinned widget.

type Repos

type Repos struct {
	*views.TextWidget
	// contains filtered or unexported fields
}

Repos represents the github repositories of the authenticated user.

func RepoWidget

func RepoWidget(app *tview.Application, config config.Config) *Repos

RepoWidget returns a new instance of repo widget.

func (*Repos) Filter

func (r *Repos) Filter(repoType string)

Filter filters the repository list according to the given repository type.

func (*Repos) First

func (r *Repos) First()

First navigates to the first page of the repository list.

func (*Repos) Last

func (r *Repos) Last()

Last navigates to the last page of the repository list.

func (*Repos) Next

func (r *Repos) Next()

Next navigates to the next page of the repository list.

func (*Repos) Prev

func (r *Repos) Prev()

Prev navigates to the previous page of the repository list.

func (*Repos) Refresh

func (r *Repos) Refresh()

Refresh refreshes the repository list.

func (*Repos) SetPageSize

func (r *Repos) SetPageSize(pageSize int)

SetPageSize sets the page size.

type User

type User struct {
	*views.TextWidget
}

User represents a github user.

func UserWidget

func UserWidget(app *tview.Application, config config.Config) *User

UserWidget returns a new instance of user widget.

func (*User) Refresh

func (u *User) Refresh()

Refresh refreshes the user widget.

type UserStats

type UserStats struct {
	*views.TextWidget
}

UserStats represents various stats of a github user.

func UserStatsWidget

func UserStatsWidget(app *tview.Application, config config.Config) *UserStats

UserStatsWidget returns a new instance of user stats widget.

func (*UserStats) Refresh

func (u *UserStats) Refresh()

Refresh refreshes the user stats widget.

Jump to

Keyboard shortcuts

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