models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package models holds the domain types shared across gh-sweep's CLI and TUI: repository references and the branch tree used to render ancestry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchNode

type BranchNode struct {
	Name           string
	SHA            string
	Ahead          int
	Behind         int
	LastCommitDate time.Time
	Parent         *BranchNode
	Children       []*BranchNode
}

BranchNode represents a node in the branch tree.

func (*BranchNode) AddChild

func (n *BranchNode) AddChild(child *BranchNode)

AddChild adds a child node to this branch.

func (*BranchNode) Depth

func (n *BranchNode) Depth() int

Depth returns the depth of this node in the tree.

func (*BranchNode) IsLeaf

func (n *BranchNode) IsLeaf() bool

IsLeaf returns true if this node has no children.

type Repository

type Repository struct {
	Owner string
	Name  string
}

Repository represents a GitHub repository reference.

func ParseRepository

func ParseRepository(repo string) *Repository

ParseRepository parses a repository string into owner and name, or returns nil when repo isn't in "owner/name" format.

func (Repository) FullName

func (r Repository) FullName() string

FullName returns the full repository name (owner/name).

Jump to

Keyboard shortcuts

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