Documentation ¶
Index ¶
- Variables
- func IsNotInstalled(err error) bool
- func IsNotUpgradable(err error) bool
- func IsUpToDate(err error) bool
- func MakePluginStorage(root string, pluginSpecs []string) (ps *pluginStorage, err error)
- type Dir
- type Git
- type OhMyZsh
- func (p *OhMyZsh) CheckUpdate(offline bool) (*string, error)
- func (p *OhMyZsh) InstallUpdate() error
- func (p *OhMyZsh) IsInstalled() (installed bool, err error)
- func (p *OhMyZsh) Load() (fpath []string, exec []string, err error)
- func (p *OhMyZsh) LoadPlugin(name string) Dir
- func (p *OhMyZsh) LoadTheme(name string) Dir
- func (p OhMyZsh) MakePlugin(_ string, params map[string]string) (*Plugin, error)
- func (p OhMyZsh) MakeTheme(_ string, params map[string]string) (*Plugin, error)
- type Plugin
Constants ¶
This section is empty.
Variables ¶
var ErrNotUpgradable = errors.New("this plugin is not upgradable")
Returned by `Plugin.CheckUpdate` and indicates that a plugin being checked is not upgradable.
var ErrUnknownPluginType = errors.New("cannot parse the spec for an unknown plugin type")
var NotInstallable = errors.New("this plugin cannot be installed from the external source")
var NotInstalled = errors.New("not installed")
Returned by `Plugin.CheckUpdate` and indicates that a plugin being checked have not been installed.
var UpToDate = errors.New("up to date")
Returned by `Plugin.CheckUpdate` and indicates that a plugin being checked is up to date.
Functions ¶
func IsNotInstalled ¶
Check if a plugin is not installed with the error value of `Plugin.CheckUpdate`.
func IsNotUpgradable ¶ added in v0.2.0
Check if a plugin is cannot be updated with the error value of `Plugin.CheckUpdate`.
func IsUpToDate ¶ added in v0.2.0
Check if a plugin is up to date with the error value of `Plugin.CheckUpdate`.
func MakePluginStorage ¶ added in v0.2.0
Types ¶
type Dir ¶
type Dir struct {
Path string
}
Dir is the plugin type loaded from a source directory.
func (Dir) InstallUpdate ¶
func (Dir) IsInstalled ¶ added in v0.2.0
type Git ¶ added in v0.1.1
type Git struct { // Remote URL URL string // We reuse the `Dir` plugin type to load the plugin into zsh. Dir Dir // contains filtered or unexported fields }
The plugin type downloaded from a Git repository.
func NewGit ¶ added in v0.1.1
NewGit creates a new Git plugin. URL must come without a scheme (like github.com/robbyrussel/oh-my-zsh).
func (*Git) CheckUpdate ¶ added in v0.1.1
func (*Git) InstallUpdate ¶ added in v0.1.1
func (*Git) IsInstalled ¶ added in v0.2.0
type OhMyZsh ¶
type OhMyZsh struct {
// contains filtered or unexported fields
}
The plugin type to deal with Oh My Zsh
func (*OhMyZsh) InstallUpdate ¶
func (*OhMyZsh) IsInstalled ¶ added in v0.2.0
func (*OhMyZsh) LoadPlugin ¶
func (OhMyZsh) MakePlugin ¶ added in v0.3.0
type Plugin ¶
type Plugin interface { // Returns `fpath` with functions to be loaded from a plugin and the lines // that are required to be executed in order to correctly load a plugin. Load() (fpath []string, exec []string, err error) // Check for update and return the message describing the update. If no // update is available, `nil` is returned instead of an update description. // If a plugin is not installed, an error must be set to `NotInstalled` and // this can be checked with the `IsNotInstalled` function. CheckUpdate(offline bool) (message *string, err error) // Install an update if available or install a plugin if not installed. Must // be called after a successful `CheckUpdate` call (that returned an update // description or the `NotInstalled` error). Otherwise it may cause a panic // or an unexpected error. InstallUpdate() error // IsInstalled checks if the plugin is actually installed. IsInstalled() (installed bool, err error) }
This is the universal interface for all plugin types loaded by `zpm`. All plugins must be used via this interface outside the `plugin` module.