Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
Extensions map[string]Extension
ExtensionRoot string
ExtensionConfigs map[string]ExtensionConfig
ConfigRoot string
}
var Sunbeam Api
func (Api) AddExtension ¶
func (api Api) AddExtension(name string, config ExtensionConfig) error
func (Api) RemoveExtension ¶
type Detail ¶
type Detail struct {
Actions []ScriptAction `json:"actions"`
DetailData
}
type DetailData ¶
type DetailData struct {
Preview string `json:"preview"`
PreviewCmd string `json:"previewCmd"`
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"`
Preferences []ScriptParam `json:"preferences" yaml:"preferences"`
Requirements []ExtensionRequirement `json:"requirements" yaml:"requirements"`
RootItems []RootItem `json:"rootItems" yaml:"rootItems"`
Scripts map[string]Script `json:"scripts" yaml:"scripts"`
Url url.URL
}
func ParseManifest ¶
type ExtensionConfig ¶
type ExtensionManifest ¶
type ExtensionManifest []ExtensionConfig
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 FormInput ¶
type FormInput struct {
Type string `json:"type"`
Required bool `json:"required"`
Title string `json:"title"`
Placeholder string `json:"placeholder"`
Default any `json:"default"`
TrueSubstitution string `json:"trueSubstitution"`
FalseSubstitution string `json:"falseSubstitution"`
Data []struct {
Title string `json:"title,omitempty"`
Value string `json:"value,omitempty"`
} `json:"data,omitempty"`
Label string `json:"label"`
}
type Script ¶
type Script struct {
Name string
Command string `json:"command" yaml:"command"`
Description string `json:"description" yaml:"description"`
Preferences []ScriptParam `json:"preferences" yaml:"preferences"`
Mode string `json:"mode" yaml:"mode"`
Cwd string `json:"cwd" yaml:"cwd"`
Params []ScriptParam `json:"params" yaml:"params"`
ShowPreview bool `json:"showPreview" yaml:"showPreview"`
}
type ScriptAction ¶
type ScriptAction struct {
Title string `json:"title" yaml:"title"`
Type string `json:"type" yaml:"type"`
Shortcut string `json:"shortcut,omitempty" yaml:"shortcut"`
Text string `json:"text,omitempty" yaml:"textfield"`
Url string `json:"url,omitempty" yaml:"url"`
Path string `json:"path,omitempty" yaml:"path"`
Extension string `json:"extension,omitempty" yaml:"extension"`
Script string `json:"script,omitempty" yaml:"script"`
Command string `json:"command,omitempty" yaml:"command"`
Dir string
OnSuccess string `json:"onSuccess,omitempty" yaml:"onSuccess"`
With map[string]ScriptInput `json:"with,omitempty" yaml:"with"`
}
type ScriptInput ¶
func (ScriptInput) GetValue ¶
func (si ScriptInput) GetValue() (string, error)
func (*ScriptInput) UnmarshalJSON ¶
func (si *ScriptInput) UnmarshalJSON(bytes []byte) (err error)
func (*ScriptInput) UnmarshalYAML ¶
func (si *ScriptInput) 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 ¶
type ScriptParam ¶
Click to show internal directories.
Click to hide internal directories.