Documentation
¶
Overview ¶
Package show contains the bootstrapping and tooling for the pizza show cobra command
Index ¶
- Variables
- func InitContributor(opts *Options) (tea.Model, error)
- func InitDashboard(opts *Options) (tea.Model, error)
- func NewShowCommand() *cobra.Command
- type BackMsg
- type ContributorErrMsg
- type ContributorModel
- type DashboardModel
- func (m *DashboardModel) FetchAllContributors() error
- func (m *DashboardModel) FetchAlumniContributors() ([]client.DbPullRequestContributor, error)
- func (m *DashboardModel) FetchNewContributors() ([]client.DbPullRequestContributor, error)
- func (m DashboardModel) Init() tea.Cmd
- func (m DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m DashboardModel) View() string
- type ErrMsg
- type MainModel
- type Options
- type SelectMsg
- type SuccessMsg
Constants ¶
This section is empty.
Variables ¶
var ActiveStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(lipgloss.Color("#FF4500"))
ActiveStyle: table when selected (border:normal, border-foreground:#FF4500)
var BackToDashboard = key.NewBinding(key.WithKeys("B"), key.WithHelp("B", "back"))
var Color = lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FF4500"}
Color: the color palette (Light: #000000, Dark: #FF4500)
var Container = lipgloss.NewStyle().Width(80).Padding(0, 5)
Container: container styling (width: 80, py: 0, px: 5)
var HelpStyle = list.DefaultStyles().HelpStyle.PaddingLeft(4).PaddingBottom(1)
HelpStyle: style for help menu
var InactiveStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(lipgloss.Color("#FFFFFF"))
InactiveStyle: table when not selected (border:normal, border-foreground:#FFFFFF)
var ItemStyle = lipgloss.NewStyle().PaddingLeft(4)
ItemStyle: style applied to items in a list.Model
var ListItemTitleStyle = lipgloss.NewStyle().MarginLeft(2)
ListItemTitle: style for the list.Model title
var OpenPR = key.NewBinding(key.WithKeys("O"), key.WithHelp("O", "open pr"))
Keymaps
var PaginationStyle = list.DefaultStyles().PaginationStyle.PaddingLeft(4)
PaginationStyle: style for pagination of list.Model
var SelectedItemStyle = lipgloss.NewStyle().PaddingLeft(2).Foreground(Color)
SelectedItemStyle: style applied when the item is selected in a list.Model
var SquareBorder = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).BorderForeground(Color)
SquareBorder: Style to draw a border around a section
var TableTitle = lipgloss.NewStyle().Width(25).AlignHorizontal(lipgloss.Center).Bold(true)
TableTitle: The style for table titles (width:25, align-horizontal:center, bold:true)
var TextContainer = lipgloss.NewStyle().Padding(1, 1)
TextContainer: container for text
var ToggleHelpMenu = key.NewBinding(key.WithKeys("H"), key.WithHelp("H", "toggle help"))
var Viewport = lipgloss.NewStyle().Margin(1, 2)
STYLES Viewport: The viewport of the tui (my:2, mx:2)
var WidgetContainer = lipgloss.NewStyle().Padding(2, 2)
WidgetContainer: container for tables, and graphs (py:2, px:2)
var WindowSize tea.WindowSizeMsg
WindowSize stores the size of the terminal
Functions ¶
func InitContributor ¶
InitContributor: initializes the contributorModel
func InitDashboard ¶
FetchRepoInfo: initializes the dashboard model
func NewShowCommand ¶
NewShowCommand returns a new cobra command for 'pizza show'
Types ¶
type BackMsg ¶
type BackMsg struct{}
BackMsg: message to signal main model that we are back to dashboard when backspace is pressed
type ContributorErrMsg ¶
type ContributorErrMsg struct {
// contains filtered or unexported fields
}
ContributorErrMsg: message to signal that an error occurred when fetching contributor information
type ContributorModel ¶
type ContributorModel struct {
APIClient *client.APIClient
// contains filtered or unexported fields
}
ContributorModel holds all the information related to a contributor
func (ContributorModel) Init ¶
func (m ContributorModel) Init() tea.Cmd
func (ContributorModel) View ¶
func (m ContributorModel) View() string
type DashboardModel ¶
type DashboardModel struct {
RepositoryInfo *client.DbRepo
APIClient *client.APIClient
// contains filtered or unexported fields
}
DashboardModel holds all the information related to the repository queried (issues, stars, new contributors, alumni contributors)
func (*DashboardModel) FetchAllContributors ¶
func (m *DashboardModel) FetchAllContributors() error
FetchAllContributors: fetchs and sets all the contributors (new, alumni)
func (*DashboardModel) FetchAlumniContributors ¶
func (m *DashboardModel) FetchAlumniContributors() ([]client.DbPullRequestContributor, error)
FetchAlumniContributors: Returns all alumni contributors
func (*DashboardModel) FetchNewContributors ¶
func (m *DashboardModel) FetchNewContributors() ([]client.DbPullRequestContributor, error)
FetchNewContributors: Returns all the new contributors
func (DashboardModel) Init ¶
func (m DashboardModel) Init() tea.Cmd
func (DashboardModel) View ¶
func (m DashboardModel) View() string
type ErrMsg ¶
type ErrMsg struct {
// contains filtered or unexported fields
}
ErrMsg: this message represents an error when fetching
type MainModel ¶
type MainModel struct {
// contains filtered or unexported fields
}
MainModel: the main model is the central state manager of the TUI, decides which model is focused based on certain commands
type Options ¶
type Options struct {
// Owner: the owner of the repository
Owner string
// RepoName: the name of the repository
RepoName string
// Page is the page to be requested
Page int
// Limit is the number of records to be retrieved
Limit int
// Range is the number of days to take into account when retrieving statistics
Range int
// APIClient is the api client to interface with open sauced api
APIClient *client.APIClient
ServerContext context.Context
}
Options are the options for the pizza show command including user defined configurations