Documentation
¶
Overview ¶
Package reposrc discovers git repositories on the client filesystem and resolves a user-supplied --repo value into something the daemon can clone.
Resolution is deliberately client-side: the TUI and CLI run where the repos live, while the daemon may run on another host (DEJIMA_HOST). The default is to hand the daemon a *remote URL* (works regardless of where the daemon runs); a read-only local-copy seed is only used when the daemon is local and the repo is local-only or carries unpushed work.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitHubAvailable ¶
func GitHubAvailable() error
GitHubAvailable reports whether the gh CLI is installed and authenticated on this client. It's the precondition for reading the local identity to seed the daemon (LocalGitHubLogin); repo browsing itself is daemon-side.
func IsURL ¶
IsURL reports whether s looks like a git URL rather than a local path. It recognizes scheme URLs (https://, ssh://, git://) and scp-like SSH shorthand (git@github.com:owner/repo).
func LocalGitHubLogin ¶
LocalGitHubLogin returns the active gh account's login and token on this client — used to seed a daemon GitHub identity via `dejima auth push --github`. Switch accounts with `gh auth switch` first to push the other one. host selects which authenticated gh host to read; empty/"github.com" uses the default host, anything else (a GitHub Enterprise host) is passed to gh via --hostname so an enterprise token can be seeded.
Types ¶
type Repo ¶
type Repo struct {
Path string // absolute path on the client
Name string // base name, used as the default island name
Origin string // origin remote URL, or "" if none
}
Repo is a git repository discovered on disk.
type Resolution ¶
type Resolution struct {
Repo string // value to send as CreateIslandRequest.Repo (URL or upstream)
SeedPath string // host path to bind-mount read-only as a clone source, or ""
Mode string // "remote" or "local-copy"
Note string // human-readable explanation of what will happen
}
Resolution is the outcome of turning a --repo value into a create request.
func Resolve ¶
func Resolve(input string, daemonLocal, forceLocalCopy bool) (Resolution, error)
Resolve turns a --repo value into a Resolution. daemonLocal must be true only when the daemon shares this filesystem (no DEJIMA_HOST). forceLocalCopy forces the read-only seed path even when an origin exists (to capture unpushed work).