Documentation
¶
Overview ¶
internal/tree/tree.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTree ¶
func FormatTree(root *Node, opts FormatOptions) string
FormatTree returns a string representation of the tree with box-drawing characters.
Types ¶
type ConfidenceLevel ¶ added in v0.6.0
type ConfidenceLevel int
ConfidenceLevel represents how certain a detection is.
const ( // ConfidenceNone is the zero value for tracked (non-detected) nodes. ConfidenceNone ConfidenceLevel = iota // ConfidenceAmbiguous means multiple candidates tied. ConfidenceAmbiguous // ConfidenceMedium means a unique merge-base winner was found. ConfidenceMedium // ConfidenceHigh means a PR base branch matched. ConfidenceHigh )
type FormatOptions ¶
type FormatOptions struct {
// CurrentBranch is marked with "* " prefix
CurrentBranch string
// PRURLFunc returns the URL for a PR number (optional)
PRURLFunc func(pr int) string
// Style is used for coloring output (optional, defaults to no color)
Style *style.Style
}
FormatOptions configures tree formatting.
type Node ¶
type Node struct {
Name string
PR int // 0 if no PR
Parent *Node
Children []*Node
Detected bool // true for auto-detected, not yet persisted
Confidence ConfidenceLevel // detection confidence (only meaningful if Detected)
}
Node represents a branch in the stack tree.
func GetAncestors ¶
GetAncestors returns all ancestors from node to root (excluding the node itself).
func GetDescendants ¶
GetDescendants returns all descendants of a node (excluding the node itself).
Click to show internal directories.
Click to hide internal directories.