Documentation
¶
Overview ¶
Package sdk provides the MOPS SDK for building plugins
Index ¶
- Constants
- Variables
- func Main(pluginImpl Plugin)
- type ActionExecutor
- type ActionExecutorRPC
- type ActionExecutorRPCClient
- type ActionResult
- type AppState
- type BuildTarget
- type CLICommandExecuteArgs
- type CLICommandExecuteResponse
- type CLICommandHandler
- type CLICommandInfo
- type DynamicProvider
- type DynamicProviderRPC
- type DynamicProviderRPCClient
- type ExecutorExecuteArgs
- type InteractiveFunctionCallArgs
- type InteractiveFunctionCallResponse
- type InteractiveGoFunction
- type Menu
- type MenuAction
- type MenuConfig
- type MenuEntry
- type MopsPlugin
- type MopsVersionConstraint
- type NavMsg
- type PlatformInfo
- type Plugin
- type PluginBase
- func (p *PluginBase) AddCLICommand(name string, handler CLICommandHandler)
- func (p *PluginBase) AddExecutor(executor ActionExecutor)
- func (p *PluginBase) AddInteractiveFunction(name string, fn InteractiveGoFunction)
- func (p *PluginBase) AddMenuEntry(menuID string, entry MenuEntry)
- func (p *PluginBase) AddProvider(provider DynamicProvider)
- func (p *PluginBase) Cleanup() error
- func (p *PluginBase) GetCLICommands() (map[string]CLICommandHandler, error)
- func (p *PluginBase) GetInfo() PluginInfo
- func (p *PluginBase) GetMenuEntries() (map[string][]MenuEntry, error)
- func (p *PluginBase) Initialize(config map[string]any) error
- func (p *PluginBase) RegisterExecutors() []ActionExecutor
- func (p *PluginBase) RegisterInteractiveFunctions() map[string]InteractiveGoFunction
- func (p *PluginBase) RegisterProviders() []DynamicProvider
- func (p *PluginBase) ValidateConfig(config map[string]any) error
- func (p *PluginBase) WithCLICommand(name string, handler CLICommandHandler) *PluginBase
- func (p *PluginBase) WithInteractiveFunction(name string, fn InteractiveGoFunction) *PluginBase
- func (p *PluginBase) WithMenuEntry(menuID string, entry MenuEntry) *PluginBase
- func (p *PluginBase) WithSimpleExecutor(actionType string, fn func(entry MenuEntry, input string) ActionResult) *PluginBase
- func (p *PluginBase) WithSimpleProvider(name string, fn func(param string) ([]MenuEntry, error)) *PluginBase
- type PluginBuilder
- func (b *PluginBuilder) AddDependency(dependency string) *PluginBuilder
- func (b *PluginBuilder) AddTag(tag string) *PluginBuilder
- func (b *PluginBuilder) Build() Plugin
- func (b *PluginBuilder) SetAuthor(author string) *PluginBuilder
- func (b *PluginBuilder) SetDefaultConfig(config map[string]any) *PluginBuilder
- func (b *PluginBuilder) SetHomepage(homepage string) *PluginBuilder
- func (b *PluginBuilder) SetLicense(license string) *PluginBuilder
- func (b *PluginBuilder) SetMopsVersions(minVersion, maxVersion string) *PluginBuilder
- func (b *PluginBuilder) WithCLICommand(name, description string, handler CLICommandHandler) *PluginBuilder
- func (b *PluginBuilder) WithInteractiveFunction(name string, fn InteractiveGoFunction) *PluginBuilder
- func (b *PluginBuilder) WithMenuEntry(menuID string, entry MenuEntry) *PluginBuilder
- func (b *PluginBuilder) WithSimpleExecutor(actionType string, fn func(entry MenuEntry, input string) ActionResult) *PluginBuilder
- func (b *PluginBuilder) WithSimpleProvider(name, description string, fn func(param string) ([]MenuEntry, error)) *PluginBuilder
- type PluginInfo
- type PluginInfoRPC
- type PluginMetadata
- type PluginRPCClient
- func (g *PluginRPCClient) Cleanup() error
- func (g *PluginRPCClient) GetCLICommands() (map[string]CLICommandHandler, error)
- func (g *PluginRPCClient) GetInfo() PluginInfo
- func (g *PluginRPCClient) GetMenuEntries() (map[string][]MenuEntry, error)
- func (g *PluginRPCClient) Initialize(config map[string]any) error
- func (g *PluginRPCClient) RegisterExecutors() []ActionExecutor
- func (g *PluginRPCClient) RegisterInteractiveFunctions() map[string]InteractiveGoFunction
- func (g *PluginRPCClient) RegisterProviders() []DynamicProvider
- func (g *PluginRPCClient) ValidateConfig(config map[string]any) error
- type PluginRPCServer
- func (s *PluginRPCServer) CallInteractiveFunction(args *InteractiveFunctionCallArgs, resp *InteractiveFunctionCallResponse) error
- func (s *PluginRPCServer) Cleanup(args interface{}, resp *error) error
- func (s *PluginRPCServer) ExecuteAction(args *ExecutorExecuteArgs, resp *ActionResult) error
- func (s *PluginRPCServer) ExecuteCLICommand(args *CLICommandExecuteArgs, resp *CLICommandExecuteResponse) error
- func (s *PluginRPCServer) GenerateProviderEntries(args *ProviderGenerateEntriesArgs, resp *[]MenuEntry) error
- func (s *PluginRPCServer) GetCLICommands(args interface{}, resp *map[string]CLICommandInfo) error
- func (s *PluginRPCServer) GetInfo(args interface{}, resp *PluginInfoRPC) error
- func (s *PluginRPCServer) GetMenuEntries(args interface{}, resp *map[string][]MenuEntry) error
- func (s *PluginRPCServer) Initialize(configJSON string, resp *error) error
- func (s *PluginRPCServer) RegisterExecutors(args interface{}, resp *[]ActionExecutorRPC) error
- func (s *PluginRPCServer) RegisterInteractiveFunctions(args interface{}, resp *map[string]string) error
- func (s *PluginRPCServer) RegisterProviders(args interface{}, resp *[]DynamicProviderRPC) error
- func (s *PluginRPCServer) ValidateConfig(args map[string]any, resp *error) error
- type ProviderGenerateEntriesArgs
- type Registry
- type RepositoryPlugin
- type RepositoryPluginAsset
- type RepositoryRegistry
- type SimpleExecutor
- type SimpleProvider
Constants ¶
const ( PluginName = "mops-plugin" ProtocolVersion = 1 )
Variables ¶
var PluginMap = map[string]plugin.Plugin{ PluginName: &MopsPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
Types ¶
type ActionExecutor ¶
type ActionExecutor interface {
GetActionType() string
Execute(entry MenuEntry, input string) ActionResult
}
ActionExecutor is an interface that executes actions
type ActionExecutorRPC ¶
type ActionExecutorRPC struct {
ActionType string
}
type ActionExecutorRPCClient ¶
type ActionExecutorRPCClient struct {
// contains filtered or unexported fields
}
func (*ActionExecutorRPCClient) Execute ¶
func (a *ActionExecutorRPCClient) Execute(entry MenuEntry, input string) ActionResult
func (*ActionExecutorRPCClient) GetActionType ¶
func (a *ActionExecutorRPCClient) GetActionType() string
type ActionResult ¶
type ActionResult struct {
Success bool
Output string
Error error
ShowOutput bool
Title string
IsStreaming bool
RefreshMenu bool // Indicates if the parent menu should refresh its dynamic content
}
ActionResult represents the result of executing an action
type BuildTarget ¶
type BuildTarget struct {
OS string `yaml:"os"`
Arch string `yaml:"arch"`
Output string `yaml:"output"`
}
BuildTarget represents a build target configuration
type CLICommandExecuteArgs ¶
type CLICommandHandler ¶
CLICommandHandler handles CLI command execution
type CLICommandInfo ¶
type CLICommandInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Usage string `json:"usage"`
Examples []string `json:"examples"`
}
CLICommandInfo describes a CLI command provided by the plugin
type DynamicProvider ¶
DynamicProvider is an interface that provides dynamic menu entries
type DynamicProviderRPCClient ¶
type DynamicProviderRPCClient struct {
// contains filtered or unexported fields
}
RPC client implementations
func (*DynamicProviderRPCClient) GetEntries ¶
func (d *DynamicProviderRPCClient) GetEntries(param string) ([]MenuEntry, error)
func (*DynamicProviderRPCClient) GetName ¶
func (d *DynamicProviderRPCClient) GetName() string
type ExecutorExecuteArgs ¶
type InteractiveGoFunction ¶
type InteractiveGoFunction func(ctx context.Context, outputChan chan<- string, inputChan <-chan string, params map[string]interface{}) error
InteractiveGoFunction represents a Go function that can be executed with real-time interaction
type Menu ¶
type Menu struct {
ID string `yaml:"id"`
Title string `yaml:"title"`
Input bool `yaml:"input,omitempty"`
Entries []MenuEntry `yaml:"entries,omitempty"`
ConfirmAction *MenuAction `yaml:"confirm_action,omitempty"`
CancelKey string `yaml:"cancel_key,omitempty"`
CancelNextID string `yaml:"cancel_next_id,omitempty"`
Provider string `yaml:"provider,omitempty"`
ProviderParam string `yaml:"provider_param,omitempty"`
Map map[string]Menu `yaml:"-"`
}
Menu represents a menu definition
type MenuAction ¶
type MenuAction struct {
Action string `yaml:"action"`
Target string `yaml:"target,omitempty"`
Command string `yaml:"command,omitempty"`
NextID string `yaml:"next_id,omitempty"`
Params map[string]interface{} `yaml:"params,omitempty"`
}
MenuAction represents a menu action
type MenuConfig ¶
type MenuConfig struct {
Menus []Menu `yaml:"menus"`
}
MenuConfig represents the menu configuration
type MenuEntry ¶
type MenuEntry struct {
Key string `yaml:"key"`
Label string `yaml:"label"`
Action string `yaml:"action"`
Target string `yaml:"target,omitempty"`
Message string `yaml:"message,omitempty"`
Command string `yaml:"command,omitempty"`
NextID string `yaml:"next_id,omitempty"`
FilePath string `yaml:"file_path,omitempty"`
Params map[string]interface{} `yaml:"params,omitempty"`
IsDynamic bool `yaml:"-"`
KeyBind string `yaml:"key_bind,omitempty"`
IsInteractive bool `yaml:"is_interactive,omitempty"`
}
MenuEntry represents a menu entry
type MopsPlugin ¶
type MopsPlugin struct {
// Impl Injection
Impl Plugin
}
MopsPlugin is the implementation of plugin.Plugin so we can serve/consume this
type MopsVersionConstraint ¶
type MopsVersionConstraint struct {
MinVersion string `yaml:"min_version"`
MaxVersion string `yaml:"max_version"`
}
MopsVersionConstraint represents MOPS version compatibility
type PlatformInfo ¶
PlatformInfo represents platform information for plugin distribution
func GetCurrentPlatform ¶
func GetCurrentPlatform() PlatformInfo
GetCurrentPlatform returns the current platform information
type Plugin ¶
type Plugin interface {
GetInfo() PluginInfo
Initialize(config map[string]any) error
RegisterProviders() []DynamicProvider
RegisterExecutors() []ActionExecutor
RegisterInteractiveFunctions() map[string]InteractiveGoFunction
GetCLICommands() (map[string]CLICommandHandler, error)
GetMenuEntries() (map[string][]MenuEntry, error)
Cleanup() error
ValidateConfig(config map[string]any) error
}
Plugin is the interface that all plugins must implement
type PluginBase ¶
type PluginBase struct {
// contains filtered or unexported fields
}
PluginBase provides a base implementation for mops plugins
func NewPluginBase ¶
func NewPluginBase(info PluginInfo) *PluginBase
NewPluginBase creates a new plugin base
func (*PluginBase) AddCLICommand ¶
func (p *PluginBase) AddCLICommand(name string, handler CLICommandHandler)
AddCLICommand adds a CLI command to the plugin
func (*PluginBase) AddExecutor ¶
func (p *PluginBase) AddExecutor(executor ActionExecutor)
AddExecutor adds an action executor to the plugin
func (*PluginBase) AddInteractiveFunction ¶
func (p *PluginBase) AddInteractiveFunction(name string, fn InteractiveGoFunction)
AddInteractiveFunction adds an interactive function to the plugin
func (*PluginBase) AddMenuEntry ¶
func (p *PluginBase) AddMenuEntry(menuID string, entry MenuEntry)
AddMenuEntry adds a menu entry to a specific menu
func (*PluginBase) AddProvider ¶
func (p *PluginBase) AddProvider(provider DynamicProvider)
AddProvider adds a dynamic provider to the plugin
func (*PluginBase) Cleanup ¶
func (p *PluginBase) Cleanup() error
Cleanup performs cleanup when the plugin is being unloaded
func (*PluginBase) GetCLICommands ¶
func (p *PluginBase) GetCLICommands() (map[string]CLICommandHandler, error)
GetCLICommands returns CLI command handlers
func (*PluginBase) GetInfo ¶
func (p *PluginBase) GetInfo() PluginInfo
GetInfo returns metadata about the plugin
func (*PluginBase) GetMenuEntries ¶
func (p *PluginBase) GetMenuEntries() (map[string][]MenuEntry, error)
GetMenuEntries returns menu entries that should be added to menus
func (*PluginBase) Initialize ¶
func (p *PluginBase) Initialize(config map[string]any) error
Initialize sets up the plugin with the provided config
func (*PluginBase) RegisterExecutors ¶
func (p *PluginBase) RegisterExecutors() []ActionExecutor
RegisterExecutors registers action executors with mops
func (*PluginBase) RegisterInteractiveFunctions ¶
func (p *PluginBase) RegisterInteractiveFunctions() map[string]InteractiveGoFunction
RegisterInteractiveFunctions registers interactive functions with mops
func (*PluginBase) RegisterProviders ¶
func (p *PluginBase) RegisterProviders() []DynamicProvider
RegisterProviders registers dynamic providers with mops
func (*PluginBase) ValidateConfig ¶
func (p *PluginBase) ValidateConfig(config map[string]any) error
ValidateConfig validates the plugin configuration
func (*PluginBase) WithCLICommand ¶
func (p *PluginBase) WithCLICommand(name string, handler CLICommandHandler) *PluginBase
WithCLICommand adds a CLI command to the plugin base
func (*PluginBase) WithInteractiveFunction ¶
func (p *PluginBase) WithInteractiveFunction(name string, fn InteractiveGoFunction) *PluginBase
WithInteractiveFunction adds an interactive function to the plugin base
func (*PluginBase) WithMenuEntry ¶
func (p *PluginBase) WithMenuEntry(menuID string, entry MenuEntry) *PluginBase
WithMenuEntry adds a menu entry to the plugin base
func (*PluginBase) WithSimpleExecutor ¶
func (p *PluginBase) WithSimpleExecutor(actionType string, fn func(entry MenuEntry, input string) ActionResult) *PluginBase
WithSimpleExecutor adds a simple executor to the plugin base
func (*PluginBase) WithSimpleProvider ¶
func (p *PluginBase) WithSimpleProvider(name string, fn func(param string) ([]MenuEntry, error)) *PluginBase
WithSimpleProvider adds a simple provider to the plugin base
type PluginBuilder ¶
type PluginBuilder struct {
// contains filtered or unexported fields
}
PluginBuilder provides a fluent interface for creating plugins
func NewPluginBuilder ¶
func NewPluginBuilder(name, version, description string) *PluginBuilder
NewPluginBuilder creates a new plugin builder
func (*PluginBuilder) AddDependency ¶
func (b *PluginBuilder) AddDependency(dependency string) *PluginBuilder
AddDependency adds a dependency to the plugin
func (*PluginBuilder) AddTag ¶
func (b *PluginBuilder) AddTag(tag string) *PluginBuilder
AddTag adds a tag to the plugin
func (*PluginBuilder) SetAuthor ¶
func (b *PluginBuilder) SetAuthor(author string) *PluginBuilder
SetAuthor sets the plugin author
func (*PluginBuilder) SetDefaultConfig ¶
func (b *PluginBuilder) SetDefaultConfig(config map[string]any) *PluginBuilder
SetDefaultConfig sets the default configuration
func (*PluginBuilder) SetHomepage ¶
func (b *PluginBuilder) SetHomepage(homepage string) *PluginBuilder
SetHomepage sets the plugin homepage
func (*PluginBuilder) SetLicense ¶
func (b *PluginBuilder) SetLicense(license string) *PluginBuilder
SetLicense sets the plugin license
func (*PluginBuilder) SetMopsVersions ¶
func (b *PluginBuilder) SetMopsVersions(minVersion, maxVersion string) *PluginBuilder
SetMopsVersions sets the MOPS version constraints
func (*PluginBuilder) WithCLICommand ¶
func (b *PluginBuilder) WithCLICommand(name, description string, handler CLICommandHandler) *PluginBuilder
WithCLICommand adds a CLI command
func (*PluginBuilder) WithInteractiveFunction ¶
func (b *PluginBuilder) WithInteractiveFunction(name string, fn InteractiveGoFunction) *PluginBuilder
WithInteractiveFunction adds an interactive function
func (*PluginBuilder) WithMenuEntry ¶
func (b *PluginBuilder) WithMenuEntry(menuID string, entry MenuEntry) *PluginBuilder
WithMenuEntry adds a menu entry
func (*PluginBuilder) WithSimpleExecutor ¶
func (b *PluginBuilder) WithSimpleExecutor(actionType string, fn func(entry MenuEntry, input string) ActionResult) *PluginBuilder
WithSimpleExecutor adds a simple executor
func (*PluginBuilder) WithSimpleProvider ¶
func (b *PluginBuilder) WithSimpleProvider(name, description string, fn func(param string) ([]MenuEntry, error)) *PluginBuilder
WithSimpleProvider adds a simple provider
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
License string `json:"license"`
Homepage string `json:"homepage"`
MopsMinVersion string `json:"mops_min_version"`
MopsMaxVersion string `json:"mops_max_version"`
Dependencies []string `json:"dependencies"`
Tags []string `json:"tags"`
CLICommands []CLICommandInfo `json:"cli_commands"`
DefaultConfig map[string]any `json:"default_config"`
Platform PlatformInfo `json:"platform"`
SupportedPlatforms []PlatformInfo `json:"supported_platforms"`
}
PluginInfo contains metadata about a plugin
type PluginInfoRPC ¶
type PluginInfoRPC struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
License string `json:"license"`
Homepage string `json:"homepage"`
MopsMinVersion string `json:"mops_min_version"`
MopsMaxVersion string `json:"mops_max_version"`
Dependencies []string `json:"dependencies"`
Tags []string `json:"tags"`
CLICommands []CLICommandInfo `json:"cli_commands"`
DefaultConfigJSON string `json:"default_config_json"` // JSON-encoded config to avoid GOB issues
Platform PlatformInfo `json:"platform"`
SupportedPlatforms []PlatformInfo `json:"supported_platforms"`
}
PluginInfoRPC is a GOB-safe version of PluginInfo for RPC transport
func NewPluginInfoRPC ¶
func NewPluginInfoRPC(info PluginInfo) (PluginInfoRPC, error)
NewPluginInfoRPC converts PluginInfo to PluginInfoRPC
func (*PluginInfoRPC) ToPluginInfo ¶
func (rpc *PluginInfoRPC) ToPluginInfo() (PluginInfo, error)
ToPluginInfo converts PluginInfoRPC to PluginInfo
type PluginMetadata ¶
type PluginMetadata struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Author string `yaml:"author"`
License string `yaml:"license"`
Homepage string `yaml:"homepage"`
Repository string `yaml:"repository"`
Tags []string `yaml:"tags"`
MopsVersion MopsVersionConstraint `yaml:"mops_version"`
BuildTargets []BuildTarget `yaml:"build_targets"`
DefaultConfig map[string]any `yaml:"default_config"`
CLICommands []CLICommandInfo `yaml:"cli_commands"`
}
PluginMetadata represents the plugin.yaml file structure
type PluginRPCClient ¶
type PluginRPCClient struct {
// contains filtered or unexported fields
}
PluginRPCClient is an implementation of Plugin that talks over RPC.
func (*PluginRPCClient) Cleanup ¶
func (g *PluginRPCClient) Cleanup() error
func (*PluginRPCClient) GetCLICommands ¶
func (g *PluginRPCClient) GetCLICommands() (map[string]CLICommandHandler, error)
func (*PluginRPCClient) GetInfo ¶
func (g *PluginRPCClient) GetInfo() PluginInfo
func (*PluginRPCClient) GetMenuEntries ¶
func (g *PluginRPCClient) GetMenuEntries() (map[string][]MenuEntry, error)
func (*PluginRPCClient) Initialize ¶
func (g *PluginRPCClient) Initialize(config map[string]any) error
func (*PluginRPCClient) RegisterExecutors ¶
func (g *PluginRPCClient) RegisterExecutors() []ActionExecutor
func (*PluginRPCClient) RegisterInteractiveFunctions ¶
func (g *PluginRPCClient) RegisterInteractiveFunctions() map[string]InteractiveGoFunction
func (*PluginRPCClient) RegisterProviders ¶
func (g *PluginRPCClient) RegisterProviders() []DynamicProvider
func (*PluginRPCClient) ValidateConfig ¶
func (g *PluginRPCClient) ValidateConfig(config map[string]any) error
type PluginRPCServer ¶
type PluginRPCServer struct {
Impl Plugin
}
PluginRPCServer is the RPC server that PluginRPCClient talks to
func (*PluginRPCServer) CallInteractiveFunction ¶
func (s *PluginRPCServer) CallInteractiveFunction(args *InteractiveFunctionCallArgs, resp *InteractiveFunctionCallResponse) error
func (*PluginRPCServer) Cleanup ¶
func (s *PluginRPCServer) Cleanup(args interface{}, resp *error) error
func (*PluginRPCServer) ExecuteAction ¶
func (s *PluginRPCServer) ExecuteAction(args *ExecutorExecuteArgs, resp *ActionResult) error
func (*PluginRPCServer) ExecuteCLICommand ¶
func (s *PluginRPCServer) ExecuteCLICommand(args *CLICommandExecuteArgs, resp *CLICommandExecuteResponse) error
func (*PluginRPCServer) GenerateProviderEntries ¶
func (s *PluginRPCServer) GenerateProviderEntries(args *ProviderGenerateEntriesArgs, resp *[]MenuEntry) error
func (*PluginRPCServer) GetCLICommands ¶
func (s *PluginRPCServer) GetCLICommands(args interface{}, resp *map[string]CLICommandInfo) error
func (*PluginRPCServer) GetInfo ¶
func (s *PluginRPCServer) GetInfo(args interface{}, resp *PluginInfoRPC) error
func (*PluginRPCServer) GetMenuEntries ¶
func (s *PluginRPCServer) GetMenuEntries(args interface{}, resp *map[string][]MenuEntry) error
func (*PluginRPCServer) Initialize ¶
func (s *PluginRPCServer) Initialize(configJSON string, resp *error) error
func (*PluginRPCServer) RegisterExecutors ¶
func (s *PluginRPCServer) RegisterExecutors(args interface{}, resp *[]ActionExecutorRPC) error
func (*PluginRPCServer) RegisterInteractiveFunctions ¶
func (s *PluginRPCServer) RegisterInteractiveFunctions(args interface{}, resp *map[string]string) error
func (*PluginRPCServer) RegisterProviders ¶
func (s *PluginRPCServer) RegisterProviders(args interface{}, resp *[]DynamicProviderRPC) error
func (*PluginRPCServer) ValidateConfig ¶
func (s *PluginRPCServer) ValidateConfig(args map[string]any, resp *error) error
type Registry ¶
type Registry interface {
RegisterProvider(provider DynamicProvider)
RegisterExecutor(executor ActionExecutor)
GetProvider(name string) (DynamicProvider, bool)
GetExecutor(actionType string) (ActionExecutor, bool)
ListProviders() []string
ListExecutors() []string
}
Registry interface for managing providers and executors
type RepositoryPlugin ¶
type RepositoryPlugin struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
License string `json:"license"`
Homepage string `json:"homepage"`
Repository string `json:"repository"`
Tags []string `json:"tags"`
MopsVersion MopsVersionConstraint `json:"mops_version"`
Platforms map[string]RepositoryPluginAsset `json:"platforms"`
Checksums map[string]string `json:"checksums"`
LastUpdated time.Time `json:"last_updated"`
}
RepositoryPlugin represents a plugin entry in a repository registry
type RepositoryPluginAsset ¶
type RepositoryPluginAsset struct {
Platform PlatformInfo `json:"platform"`
DownloadURL string `json:"download_url"`
Size int64 `json:"size"`
Checksum string `json:"checksum"`
Filename string `json:"filename"`
}
RepositoryPluginAsset represents a platform-specific plugin asset
type RepositoryRegistry ¶
type RepositoryRegistry struct {
Repository struct {
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
LastUpdated time.Time `json:"last_updated"`
Version string `json:"version"`
} `json:"repository"`
Plugins map[string]RepositoryPlugin `json:"plugins"`
}
RepositoryRegistry represents a registry of all plugins in a repository
type SimpleExecutor ¶
type SimpleExecutor struct {
// contains filtered or unexported fields
}
SimpleExecutor provides a convenient way to create basic executors
func NewSimpleExecutor ¶
func NewSimpleExecutor(actionType string, fn func(entry MenuEntry, input string) ActionResult) *SimpleExecutor
NewSimpleExecutor creates a new simple executor
func (*SimpleExecutor) Execute ¶
func (e *SimpleExecutor) Execute(entry MenuEntry, input string) ActionResult
Execute executes the action
func (*SimpleExecutor) GetActionType ¶
func (e *SimpleExecutor) GetActionType() string
GetActionType returns the action type
type SimpleProvider ¶
type SimpleProvider struct {
// contains filtered or unexported fields
}
SimpleProvider provides a convenient way to create basic providers
func NewSimpleProvider ¶
func NewSimpleProvider(name string, fn func(param string) ([]MenuEntry, error)) *SimpleProvider
NewSimpleProvider creates a new simple provider
func (*SimpleProvider) GetEntries ¶
func (p *SimpleProvider) GetEntries(param string) ([]MenuEntry, error)
GetEntries returns the menu entries
func (*SimpleProvider) GetName ¶
func (p *SimpleProvider) GetName() string
GetName returns the provider name