Documentation
¶
Overview ¶
Package board is prs's view on gotermboard: every open pull request as a row, its description a key away, and a key per action.
Index ¶
- Constants
- func Refused(window config.WindowAction) error
- type Board
- func (b *Board) Actions() []gotermboard.Action
- func (b *Board) Frame(now time.Time, _ string) gotermboard.Frame
- func (b *Board) Gaps() []string
- func (b *Board) Groupings() []string
- func (b *Board) ReadDetails()
- func (b *Board) Receive(m *gotermboard.Model, msg tea.Msg) tea.Cmd
- func (b *Board) Rows(now time.Time) []Row
- func (b *Board) Snapshot(now time.Time) Snapshot
- func (b *Board) Sources() []gotermboard.Refresher
- func (b *Board) Table(now time.Time) []gotermboard.Line
- func (b *Board) UnderWay() string
- type Repos
- type Row
- type Snapshot
Constants ¶
const View = "pull-requests"
View is the board's one tab, the name --view takes.
Variables ¶
This section is empty.
Functions ¶
func Refused ¶
func Refused(window config.WindowAction) error
Refused says why a window action cannot have its key, and is nil where the key is free. A board's key sits ahead of the table's, so a window action on a bound key would take it. esc backs out of whatever is open, which no table action names.
Types ¶
type Board ¶
type Board struct {
// contains filtered or unexported fields
}
Board is the open pull requests of the repos a registry names, read from each provider that hosts one.
func New ¶
func New(repos Repos, windows []config.WindowAction) (*Board, error)
New is a board over repos, with the window actions the config adds. It refuses a window action on a key the board already binds.
func (*Board) Actions ¶
func (b *Board) Actions() []gotermboard.Action
Actions is gotermboard.Keyed's. The board's keys sit ahead of the table's, so the footer and the ? overlay list them first.
func (*Board) Frame ¶
Frame is gotermboard.Board's: one group of every open pull request, oldest first.
func (*Board) Gaps ¶ added in v0.4.0
Gaps names each provider whose newest read failed, or read and noted pull requests it left out, with why. A note leaves rows out as a failure does, so both count.
func (*Board) ReadDetails ¶ added in v0.4.0
func (b *Board) ReadDetails()
ReadDetails has each listing that lands read its rows' details in the background, for the description to show. A board printed once leaves it off, since nothing waits for them.
func (*Board) Rows ¶ added in v0.4.0
Rows is every pull request the board holds, oldest first, and empty rather than nil, so no rows print as [].
func (*Board) Sources ¶
func (b *Board) Sources() []gotermboard.Refresher
Sources is gotermboard.Board's.
type Repos ¶ added in v0.4.0
Repos is what the board reads: the repos the registry at Registry names, or with no registry, Owners whole. From is the config layer that chose, one of config's From constants.
type Row ¶ added in v0.4.0
type Row struct {
pullrequests.PullRequest
StackedOn *int `json:"stacked_on"`
}
Row is one pull request as both --json outputs print it, with the open pull request it is stacked on where there is one. cmd/prs/list.schema.json is its shape.
type Snapshot ¶
type Snapshot struct {
View string `json:"view"`
Registry string `json:"registry"`
Owners []string `json:"owners,omitempty"`
PullRequests []Row `json:"pull_requests"`
Sources []gotermboard.Status `json:"sources"`
}
Snapshot is what --json prints: the rows the board draws, and how each read stands. Registry is empty where the board reads owners whole, and Owners names them, with @me for the token's own account.