Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
func (*Api) IsExtensionInstalled ¶ added in v0.0.9
func (*Api) LoadExtensions ¶ added in v0.0.9
type Command ¶ added in v0.0.9
type Command struct {
Name string
Exec string `json:"exec" yaml:"exec"`
Description string `json:"description" yaml:"description"`
Preferences []ScriptInput `json:"preferences" yaml:"preferences"`
Inputs []ScriptInput `json:"inputs" yaml:"inputs"`
Page Page `json:"page" yaml:"page"`
OnSuccess string `json:"onSuccess" yaml:"onSuccess"`
}
type Detail ¶
type Detail struct {
Actions []ScriptAction `json:"actions"`
DetailData
}
type DetailData ¶
type DetailData struct {
Preview string `json:"preview"`
Metadatas []ScriptMetadata `json:"metadatas"`
}
type Extension ¶
type Extension struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Name string `json:"name" yaml:"name"`
PostInstall string `json:"postInstall" yaml:"postInstall"`
Root string `json:"root" yaml:"root"`
Preferences []ScriptInput `json:"preferences" yaml:"preferences"`
Requirements []ExtensionRequirement `json:"requirements" yaml:"requirements"`
RootItems []RootItem `json:"rootItems" yaml:"rootItems"`
Commands map[string]Command `json:"commands" yaml:"commands"`
}
type ExtensionRequirement ¶
type ExtensionRequirement struct {
Which string `json:"which" yaml:"which"`
HomePage string `json:"homePage" yaml:"homePage"`
}
func (ExtensionRequirement) Check ¶
func (r ExtensionRequirement) Check() bool
type Optional ¶ added in v0.0.9
func (*Optional[T]) UnmarshalJSON ¶ added in v0.0.9
UnmarshalJSON is implemented by deferring to the wrapped type (T). It will be called only if the value is defined in the JSON payload.
type ScriptAction ¶
type ScriptAction struct {
Title string `json:"title"`
Type string `json:"type"`
Shortcut string `json:"shortcut"`
Text string `json:"text"`
Url string `json:"url"`
Path string `json:"path"`
Extension string `json:"extension"`
Script string `json:"script"`
Command string `json:"command"`
Dir string
OnSuccess string `json:"onSuccess"`
With map[string]ScriptInputWithValue `json:"with"`
}
type ScriptInput ¶
type ScriptInput struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type"`
Title string `json:"title"`
Placeholder Optional[string] `json:"placeholder"`
Default Optional[any] `json:"defaultValue" yaml:"defaultValue"`
Data []struct {
Title string `json:"title,omitempty"`
Value string `json:"value,omitempty"`
} `json:"data,omitempty"`
Label string `json:"label"`
}
type ScriptInputWithValue ¶ added in v0.0.9
type ScriptInputWithValue struct {
Value any
ScriptInput
}
func (ScriptInputWithValue) GetValue ¶ added in v0.0.9
func (si ScriptInputWithValue) GetValue() (any, error)
func (*ScriptInputWithValue) UnmarshalJSON ¶ added in v0.0.9
func (si *ScriptInputWithValue) UnmarshalJSON(bytes []byte) (err error)
func (*ScriptInputWithValue) UnmarshalYAML ¶ added in v0.0.9
func (si *ScriptInputWithValue) UnmarshalYAML(value *yaml.Node) (err error)
type ScriptItem ¶
type ScriptItem struct {
Id string `json:"id"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
DetailData
Accessories []string `json:"accessories"`
Actions []ScriptAction `json:"actions"`
}
func ParseListItems ¶
func ParseListItems(output string) (items []ScriptItem, err error)
func (ScriptItem) PreviewCommand ¶
func (li ScriptItem) PreviewCommand() *exec.Cmd
type ScriptMetadata ¶
Click to show internal directories.
Click to hide internal directories.