github

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github answers the app's GitHub screen on hosts where its POSIX sh scripts cannot run (native Windows, ADR 0007): the working trees the user is in (github.repos), what gh reports for one of them (github.activity) and the state of single issues and pull requests (github.status). It runs the same git and gh commands as the app's scripts (lib/services/github_repos.dart); keep both in step.

Index

Constants

View Source
const (

	// MaxRepos working trees are inspected and listed.
	MaxRepos = 20
)

Variables

This section is empty.

Functions

func Activity

Activity asks gh for the repository's description, its open pull requests and issues, and the pull request of p.Branch, the gh calls in parallel, as the app's sh script does. gh runs in p.Path when that is a directory.

func LiveDirs

func LiveDirs(s *ptable.Snapshot, owner string, holders []int, self int) []string

LiveDirs returns the working directories of owner's processes that run under an SSH session or under a holder (holders: their pids) — shells, coding agents and whatever runs in them — each directory once. The process self and everything under it (the bridge asking, and its git and gh) are left out. On Windows the directory is read from the process's PEB (ptable).

func Repos

func Repos(ctx context.Context, r Runner, cands []Candidate) wire.GitHubReposResult

Repos lists the working trees of cands, newest first: each directory counts with its newest time, directories outside a working tree and working trees without a remote are dropped, and at most MaxRepos are inspected. It mirrors the app's sh script (`@@REPO`).

func Status added in v0.10.0

Status asks gh for the state of each issue and pull request, in parallel: a pull request's state, an issue's state and, with a branch, the state of that branch's pull request (as gh reports them: OPEN, CLOSED, MERGED). Items gh cannot tell about (no gh, not signed in, not found) are left out; the rest keep their order.

Types

type Candidate

type Candidate struct {
	Dir string
	At  int64
}

Candidate is a directory the user worked in and when, in unix ms (0 when unknown).

type Runner

type Runner struct {
	Env []string
}

Runner runs git, gh and ssh with one environment, so they are found and behave as in the user's terminals.

func (Runner) Look

func (r Runner) Look(name string) string

Look returns the path of the program name on Env's PATH, "" when it is not there.

Jump to

Keyboard shortcuts

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