Documentation ¶
Index ¶
- Constants
- Variables
- func ComputePluginID(name string) string
- func CurrentArch() string
- type Action
- type AppOverrides
- type CommandInputType
- type CommandValueType
- type DownloadedPlugin
- type Downloader
- type GitHubDownloader
- type Loader
- func (l *Loader) DownloadPlugin(ctx context.Context, name string, verConstr *semver.Constraints, src string, ...) (*Plugin, error)
- func (l *Loader) LoadPlugin(ctx context.Context, name, src string, verConstr *semver.Constraints, ...) (*Plugin, error)
- func (l *Loader) MatchingVersion(ctx context.Context, name, src string, verConstr *semver.Constraints) (matching, latest *semver.Version, err error)
- type Plugin
- func (p *Plugin) Client() *client.Client
- func (p *Plugin) CommandArgs(cmd string) map[string]interface{}
- func (p *Plugin) HasAction(a Action) bool
- func (p *Plugin) ID() string
- func (p *Plugin) Locked() *lockfile.Plugin
- func (p *Plugin) Normalize() error
- func (p *Plugin) Prepare(ctx context.Context, log logger.Logger, ...) error
- func (p *Plugin) PriorityFor(cmd string) []int
- func (p *Plugin) Secrets() []*PluginSecret
- func (p *Plugin) ShortName() string
- func (p *Plugin) Stop() error
- func (p *Plugin) SupportsApp(app string) bool
- func (p *Plugin) SupportsType(typ, dep string, other map[string]interface{}) bool
- func (p *Plugin) Validate() error
- type PluginCommand
- type PluginCommandFlag
- type PluginHooks
- type PluginMatch
- type PluginSecret
- type PluginType
- type VCSDownloader
Constants ¶
View Source
const ( DefaultPluginSourceFmt = "https://github.com/outblocks/cli-plugin-%s" DefaultAuthor = "outblocks" )
View Source
const DefaultPriority = 1000
Variables ¶
View Source
var ( ErrPluginNotFound = errors.New("plugin not found") ErrPluginNoMatchingVersionFound = errors.New("no matching version for plugin not found") )
View Source
var ( CommandValueTypes = []string{"str", "string", "bool", "boolean", "int", "integer", "strings", "stringarray"} CommandInputTypes = []string{"app_states", "dependency_states", "plugin_state"} )
View Source
var GitHubRegex = regexp.MustCompile(`^https://github\.com/(?P<owner>[^/]+)/(?P<name>[^/]+)/?$`)
Functions ¶
func ComputePluginID ¶ added in v0.1.54
func CurrentArch ¶
func CurrentArch() string
Types ¶
type AppOverrides ¶ added in v0.1.132
type AppOverrides struct { Function struct { Archive *bool `json:"archive"` } `json:"function"` }
type CommandInputType ¶ added in v0.1.56
type CommandInputType int
const ( CommandInputTypeAppStates CommandInputType = iota + 1 CommandInputTypeDependencyStates CommandInputTypePluginState )
type CommandValueType ¶ added in v0.1.56
type CommandValueType int
const ( CommandValueTypeBool CommandValueType = iota + 1 CommandValueTypeString CommandValueTypeInt CommandValueTypeStringArray )
type DownloadedPlugin ¶
type Downloader ¶
type GitHubDownloader ¶
type GitHubDownloader struct {
// contains filtered or unexported fields
}
func NewGitHubDownloader ¶
func NewGitHubDownloader() *GitHubDownloader
func (*GitHubDownloader) Download ¶
func (d *GitHubDownloader) Download(ctx context.Context, pi *pluginInfo) (*DownloadedPlugin, error)
func (*GitHubDownloader) MatchingVersion ¶ added in v0.1.2
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (*Loader) DownloadPlugin ¶
func (*Loader) LoadPlugin ¶
type Plugin ¶
type Plugin struct { Name string `json:"name"` Short string `json:"short"` Author string `json:"author"` Usage string `json:"usage"` Description string `json:"description"` Cmd map[string]*command.StringCommand `json:"cmd"` Actions []string `json:"actions"` Priorities map[string][]int `json:"priorities"` Hooks []*PluginHooks `json:"hooks"` Supports []string `json:"supports"` StateTypes []string `json:"state_types"` SecretsTypes []string `json:"secrets_types"` SupportedTypes []*PluginType `json:"supported_types"` Commands map[string]*PluginCommand `json:"commands"` SecretsRepr yaml.MapSlice `json:"secrets"` AppOverrides AppOverrides `json:"app_overrides"` Dir string `json:"-"` CacheDir string `json:"-"` Version *semver.Version `json:"-"` // contains filtered or unexported fields }
func (*Plugin) CommandArgs ¶ added in v0.1.13
func (*Plugin) PriorityFor ¶ added in v0.1.107
func (*Plugin) Secrets ¶ added in v0.1.109
func (p *Plugin) Secrets() []*PluginSecret
func (*Plugin) SupportsApp ¶
func (*Plugin) SupportsType ¶
type PluginCommand ¶ added in v0.1.13
type PluginCommand struct { Short string `json:"short"` Long string `json:"long"` Input []string `json:"input"` Flags []*PluginCommandFlag `json:"flags"` // contains filtered or unexported fields }
func (*PluginCommand) InputTypes ¶ added in v0.1.56
func (p *PluginCommand) InputTypes() []CommandInputType
func (*PluginCommand) Proto ¶ added in v0.1.56
func (p *PluginCommand) Proto(args []string) *apiv1.CommandArgs
func (*PluginCommand) Validate ¶ added in v0.1.13
func (p *PluginCommand) Validate() error
type PluginCommandFlag ¶ added in v0.1.56
type PluginCommandFlag struct { Name string `json:"name"` Short string `json:"short"` Usage string `json:"usage"` Type string `json:"type"` Default interface{} `json:"default"` Required bool `json:"required"` Value interface{} `json:"-"` // contains filtered or unexported fields }
func (*PluginCommandFlag) Val ¶ added in v0.1.56
func (p *PluginCommandFlag) Val() interface{}
func (*PluginCommandFlag) Validate ¶ added in v0.1.56
func (p *PluginCommandFlag) Validate() error
func (*PluginCommandFlag) ValueType ¶ added in v0.1.56
func (p *PluginCommandFlag) ValueType() CommandValueType
type PluginHooks ¶
func (*PluginHooks) Validate ¶
func (p *PluginHooks) Validate() error
type PluginMatch ¶
type PluginSecret ¶ added in v0.1.109
type PluginType ¶
type PluginType struct { Type string `json:"type"` Match *PluginMatch `json:"match"` }
func (*PluginType) Validate ¶
func (p *PluginType) Validate() error
type VCSDownloader ¶
type VCSDownloader struct { }
func NewVCSDownloader ¶
func NewVCSDownloader() *VCSDownloader
func (*VCSDownloader) Download ¶
func (d *VCSDownloader) Download(ctx context.Context, pi *pluginInfo) (*DownloadedPlugin, error)
func (*VCSDownloader) MatchingVersion ¶ added in v0.1.2
Source Files ¶
Click to show internal directories.
Click to hide internal directories.