main 5041353

runtime.go RawHistoryFolder

1// Package port defines interfaces for external dependencies.
2package port
3
4import (
5	"context"
6	"errors"
7	"fmt"
8)
9
10// PkgConfigErrorKind describes the category of a pkg-config failure.
11type PkgConfigErrorKind string
12
13const (
14	PkgConfigErrorKindCommandMissing PkgConfigErrorKind = "command_missing"
15	PkgConfigErrorKindPackageMissing PkgConfigErrorKind = "package_missing"
16	PkgConfigErrorKindUnknown        PkgConfigErrorKind = "unknown"
17)
18
19var (
20	// ErrPkgConfigMissing indicates pkg-config is not available on the host.
21	ErrPkgConfigMissing = errors.New("pkg-config missing")
22	// ErrPkgConfigPackageMissing indicates the requested .pc package was not found.
23	ErrPkgConfigPackageMissing = errors.New("pkg-config package missing")
24)
25
26// PkgConfigError wraps an error returned by pkg-config probing.
27type PkgConfigError struct {
28	Kind    PkgConfigErrorKind
29	Package string
30	Output  string
31	Err     error
32}
33
34func (e *PkgConfigError) Error() string {
35	if e == nil {
36		return "pkg-config error"
37	}
38	msg := fmt.Sprintf("pkg-config (%s): %s", e.Kind, e.Package)
39	if e.Output != "" {
40		msg += ": " + e.Output
41	}
42	if e.Err != nil {
43		msg += ": " + e.Err.Error()
44	}
45	return msg
46}
47
48func (e *PkgConfigError) Unwrap() error {
49	if e == nil {
50		return nil
51	}
52	return e.Err
53}
54
55// RuntimeVersionProbe provides runtime dependency discovery.
56//
57// Implementations may use pkg-config and may apply a prefix override to influence
58// pkg-config search paths.
59type RuntimeVersionProbe interface {
60	PkgConfigModVersion(ctx context.Context, pkgName string, prefix string) (string, error)
61}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close