Documentation
¶
Index ¶
- Constants
- func AddonNote(eco Ecosystem) string
- func ConfigPaths(eco Ecosystem, home string) []string
- func IsFree(id string) bool
- func ProxyURL(base string, eco Ecosystem) string
- func ProxyURLWithSlash(base string, eco Ecosystem) string
- func RequireWriter(eco Ecosystem) error
- type ConfigFile
- type ConfigOptions
- type Detected
- type Ecosystem
Constants ¶
const AddonHint = "requires the " + AddonName
AddonHint is the one-line reason shown next to an ecosystem the caller has not unlocked.
const AddonName = "Package Firewall add-on"
AddonName is the paid add-on that unlocks every registry that is not free.
Variables ¶
This section is empty.
Functions ¶
func AddonNote ¶ added in v4.2.0
AddonNote is extra guidance for a setup that configures more than one firewall prefix with different entitlements. The aur command also stages the pacman mirrorlist for the official Arch repositories (the /arch prefix), and that part needs the add-on while AUR does not.
func ConfigPaths ¶
ConfigPaths returns the candidate config files inspected for an ecosystem. (Go is detected separately via netrc + the GOPROXY environment.)
func IsFree ¶ added in v4.2.0
IsFree reports whether the ecosystem id (the firewall's, such as "aur" or "go-dev") needs no add-on.
func ProxyURLWithSlash ¶
func RequireWriter ¶
Types ¶
type ConfigFile ¶
type ConfigFile struct {
Path string
Content string
Structured bool
// Merge, when set, computes the new file content from the file's existing
// content (read by the writer) instead of replacing it. Used to fold the
// firewall settings into a user's real config non-destructively (paru.conf,
// yay config.json). The writer backs up the original before writing.
Merge func(existing string) (string, error)
// Marker is an alternative ownership needle used when reversing a Structured
// write whose content never names the proxy host — a credentials file, which
// carries only the org id and the secret. Without it uninstall declines to
// touch the file and the credential stays on disk.
Marker string
}
func ConfigFiles ¶
func ConfigFiles(eco Ecosystem, opts ConfigOptions) ([]ConfigFile, error)
type ConfigOptions ¶
type Detected ¶
type Detected struct {
Ecosystem Ecosystem
Configured bool
Path string // the config file that matched, when Configured
}
Detected reports whether a package manager's config points at the firewall.
type Ecosystem ¶
type Ecosystem struct {
ID string
Command string
DisplayName string
Prefix string
// Free is true for the registries every org may use without the add-on. The
// firewall serves go-dev and aur free; every other registry, including the Go
// proxy, needs the Package Firewall add-on.
Free bool
LiveWriter bool
}