Documentation
¶
Overview ¶
Package config reads prs's config file, which names the registry of repos or the owners read in its place, and the keys a person adds to the board.
Index ¶
Constants ¶
const ( FromVariable = RegistryVariable FromFile = "repos_registry in the config file" FromOwners = "owners in the config file" FromDefault = "the default" FromViewer = "no registry at the default, so your own repos on GitHub" )
Which layer chose the repos prs reads, in the order they are asked.
const RegistryVariable = "PRS_REPOS_REGISTRY"
RegistryVariable names the registry for one shell, ahead of the config file.
Variables ¶
This section is empty.
Functions ¶
func DefaultRegistry ¶
DefaultRegistry is where prs looks for the registry when nothing names one: repos.json under $XDG_DATA_HOME, or ~/.local/share where that is unset.
func MissingPrograms ¶
MissingPrograms is those of programs that are not on PATH.
Types ¶
type Config ¶
type Config struct {
// File is the path read, whether or not anything was there.
File string
// Exists says the file was there to read.
Exists bool
// Registry is the repo registry's path. Where it is empty, prs reads Owners whole, and
// with no Owners either, the repos the GitHub token's own account holds. ReposFrom is
// the layer that chose.
Registry string
Owners []string
ReposFrom string
// WindowActions are the keys the file adds, each opening a tmux window on a pull request.
WindowActions []WindowAction
}
Config is what the environment and the file say, with each path expanded.
type WindowAction ¶
type WindowAction struct {
Key string `yaml:"key"`
Label string `yaml:"label"`
Detail string `yaml:"detail"`
// Needs are the programs the command runs, checked before the window opens, because
// tmux reports a window opened even when its command cannot start.
Needs []string `yaml:"needs"`
// Providers limits the key to pull requests these providers host. Empty means any.
Providers []string `yaml:"providers"`
// Window is the tmux window's name, and Command the shell command it runs. Both take
// the names Placeholders lists.
Window string `yaml:"window"`
Command string `yaml:"command"`
}
WindowAction is a key that runs a command in a new tmux window, started in the pull request's checkout. It is offered only where every program it needs is on PATH.
func (WindowAction) Missing ¶
func (a WindowAction) Missing() []string
Missing is the programs the action needs that are not on PATH. The board offers its key only where none is.