Documentation
¶
Overview ¶
Package display renders forge and vcs models as plain text. Anything that emits a glyph, a placeholder, or a human-readable duration belongs here rather than in the data packages it reads, which is what keeps forge and vcs from importing each other.
Index ¶
- Constants
- func BranchRelativeLastCommit(b vcs.BranchInfo) string
- func CIConclusion(c *forge.DefaultBranchCI) string
- func CheckDuration(c forge.CheckDetail) string
- func CheckStatusDisplay(c forge.CheckDetail) string
- func ChecksSummary(c forge.ChecksStatus) string
- func CommentRelativeCreated(c forge.PRComment) string
- func CommitRelativeDate(c vcs.CommitInfo) string
- func PRActivitySummary(p *forge.PullRequest) string
- func PRDetailRelativeCreated(p forge.PRDetail) string
- func PRDetailRelativeUpdated(p forge.PRDetail) string
- func PRReviewGlyph(p *forge.PullRequest) string
- func PRReviewStatus(p forge.PullRequest) string
- func PRStatusDisplay(p forge.PullRequest) string
- func PreviewReviewStatus(p forge.PRPreview) string
- func RelativeTime(t time.Time) string
- func RelativeTimeCompact(t time.Time) string
- func RepoRelativeModified(r vcs.RepoSummary) string
- func RepoStatusSummary(r vcs.RepoSummary) string
- func StashRelativeDate(s vcs.StashDetail) string
- func WorkflowRunStatusDisplay(w forge.WorkflowRun) string
- func WorkflowSummaryStatusDisplay(w forge.WorkflowSummary) string
Constants ¶
const EmDash = "—"
EmDash stands in for a value the model does not have.
Variables ¶
This section is empty.
Functions ¶
func BranchRelativeLastCommit ¶
func BranchRelativeLastCommit(b vcs.BranchInfo) string
BranchRelativeLastCommit returns a human-readable relative time for the branch's last commit.
func CIConclusion ¶
func CIConclusion(c *forge.DefaultBranchCI) string
CIConclusion rolls the workflows up into one word: failing if any failed, pending while any is still going, passing when all succeeded, and EmDash when the commit has no runs at all.
func CheckDuration ¶
func CheckDuration(c forge.CheckDetail) string
CheckDuration renders how long the check ran, or EmDash while it's still running.
func CheckStatusDisplay ¶
func CheckStatusDisplay(c forge.CheckDetail) string
CheckStatusDisplay returns the check's lowercased conclusion once it has completed, or its in-flight status ("queued", "in progress") before then.
func ChecksSummary ¶
func ChecksSummary(c forge.ChecksStatus) string
ChecksSummary returns a one-word overall status for the checks.
func CommentRelativeCreated ¶
CommentRelativeCreated returns a human-readable relative time for the comment.
func CommitRelativeDate ¶
func CommitRelativeDate(c vcs.CommitInfo) string
CommitRelativeDate returns a human-readable relative time for the commit's date.
func PRActivitySummary ¶
func PRActivitySummary(p *forge.PullRequest) string
PRActivitySummary renders the latest activity as an age and an author, or EmDash when the pull request has neither comments nor reviews.
func PRDetailRelativeCreated ¶
PRDetailRelativeCreated returns a human-readable relative time for the pull request's creation.
func PRDetailRelativeUpdated ¶
PRDetailRelativeUpdated returns a human-readable relative time for the pull request's last update.
func PRReviewGlyph ¶
func PRReviewGlyph(p *forge.PullRequest) string
PRReviewGlyph marks an approval or a change request, or is empty otherwise.
func PRReviewStatus ¶
func PRReviewStatus(p forge.PullRequest) string
PRReviewStatus returns a human-readable summary of the pull request's review decision.
func PRStatusDisplay ¶
func PRStatusDisplay(p forge.PullRequest) string
PRStatusDisplay returns the pull request's display status label.
func PreviewReviewStatus ¶
PreviewReviewStatus reports the preview's review state in the same vocabulary the full detail uses.
func RelativeTime ¶
RelativeTime renders t as a human-readable duration relative to now (e.g. "3 days ago").
func RelativeTimeCompact ¶ added in v0.8.0
RelativeTimeCompact renders t as a duration relative to now in the narrowest form that stays readable ("3m ago", "2h ago", "5d ago"), falling back to a calendar date past a week. A table column holding a time is a handful of cells wide, which RelativeTime's "3 minutes ago" does not fit in.
func RepoRelativeModified ¶
func RepoRelativeModified(r vcs.RepoSummary) string
RepoRelativeModified returns a human-readable relative time for the repo's last modification.
func RepoStatusSummary ¶
func RepoStatusSummary(r vcs.RepoSummary) string
RepoStatusSummary renders a compact symbol-based summary of the repo's working tree state.
func StashRelativeDate ¶
func StashRelativeDate(s vcs.StashDetail) string
StashRelativeDate returns a human-readable relative time for the stash's date.
func WorkflowRunStatusDisplay ¶
func WorkflowRunStatusDisplay(w forge.WorkflowRun) string
WorkflowRunStatusDisplay returns the workflow run's display status label.
func WorkflowSummaryStatusDisplay ¶
func WorkflowSummaryStatusDisplay(w forge.WorkflowSummary) string
WorkflowSummaryStatusDisplay returns a one-word overall status for the workflow runs.
Types ¶
This section is empty.