Help us shape the future of Go! Take the 2026 Go Developer Survey

sunbeam

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Title string     `json:"title,omitempty"`
	Key   string     `json:"key,omitempty"`
	Type  ActionType `json:"type,omitempty"`

	Open   *OpenAction   `json:"-"`
	Copy   *CopyAction   `json:"-"`
	Run    *RunAction    `json:"-"`
	Exec   *ExecAction   `json:"-"`
	Edit   *EditAction   `json:"-"`
	Config *ConfigAction `json:"-"`
	Reload *ReloadAction `json:"-"`
}

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(bts []byte) error

type ActionType

type ActionType string
const (
	ActionTypeRun    ActionType = "run"
	ActionTypeOpen   ActionType = "open"
	ActionTypeCopy   ActionType = "copy"
	ActionTypeEdit   ActionType = "edit"
	ActionTypeExec   ActionType = "exec"
	ActionTypeExit   ActionType = "exit"
	ActionTypeReload ActionType = "reload"
	ActionTypeConfig ActionType = "config"
)

type CommandMode

type CommandMode string
const (
	CommandModeSearch CommandMode = "search"
	CommandModeFilter CommandMode = "filter"
	CommandModeDetail CommandMode = "detail"
	CommandModeTTY    CommandMode = "tty"
	CommandModeSilent CommandMode = "silent"
)

type CommandSpec

type CommandSpec struct {
	Name   string      `json:"name"`
	Title  string      `json:"title"`
	Hidden bool        `json:"hidden,omitempty"`
	Params []Input     `json:"params,omitempty"`
	Mode   CommandMode `json:"mode,omitempty"`
}

type ConfigAction

type ConfigAction struct {
	Extension string `json:"extension,omitempty"`
}

type CopyAction

type CopyAction struct {
	Text string `json:"text,omitempty"`
	Exit bool   `json:"exit,omitempty"`
}

type Detail

type Detail struct {
	Actions  []Action `json:"actions,omitempty"`
	Markdown string   `json:"markdown,omitempty"`
	Text     string   `json:"text,omitempty"`
}

type EditAction

type EditAction struct {
	Path   string `json:"path,omitempty"`
	Exit   bool   `json:"exit,omitempty"`
	Reload bool   `json:"reload,omitempty"`
}

type ExecAction

type ExecAction struct {
	Interactive bool   `json:"interactive,omitempty"`
	Command     string `json:"command,omitempty"`
	Dir         string `json:"dir,omitempty"`
	Exit        bool   `json:"exit,omitempty"`
}

type Input

type Input struct {
	Type     InputType `json:"type"`
	Name     string    `json:"name"`
	Title    string    `json:"title"`
	Optional bool      `json:"optional,omitempty"`
	Default  any       `json:"default,omitempty"`
}

type InputType

type InputType string
const (
	InputString  InputType = "string"
	InputBoolean InputType = "boolean"
	InputNumber  InputType = "number"
)

type List

type List struct {
	Items              []ListItem `json:"items,omitempty"`
	EmptyText          string     `json:"emptyText,omitempty"`
	ShowDetail         bool       `json:"showDetail,omitempty"`
	AutoRefreshSeconds int        `json:"autoRefreshSeconds,omitempty"`
	Actions            []Action   `json:"actions,omitempty"`
}

type ListItem

type ListItem struct {
	Id          string         `json:"id,omitempty"`
	Title       string         `json:"title"`
	Subtitle    string         `json:"subtitle,omitempty"`
	Detail      ListItemDetail `json:"detail,omitempty"`
	Accessories []string       `json:"accessories,omitempty"`
	Actions     []Action       `json:"actions,omitempty"`
}

type ListItemDetail

type ListItemDetail struct {
	Markdown string `json:"markdown,omitempty"`
	Text     string `json:"text,omitempty"`
}

type Manifest

type Manifest struct {
	Title       string        `json:"title"`
	Description string        `json:"description,omitempty"`
	Preferences []Input       `json:"preferences,omitempty"`
	Commands    []CommandSpec `json:"commands"`
}

type OpenAction

type OpenAction struct {
	Url  string `json:"url,omitempty"`
	Path string `json:"path,omitempty"`
}

type Payload

type Payload struct {
	Command     string         `json:"command"`
	Preferences map[string]any `json:"preferences"`
	Params      map[string]any `json:"params"`
	Cwd         string         `json:"cwd"`
	Query       string         `json:"query,omitempty"`
}

type Platfom

type Platfom string
const (
	PlatformLinux Platfom = "linux"
	PlatformMac   Platfom = "macos"
)

type ReloadAction

type ReloadAction struct {
	Params map[string]any `json:"params,omitempty"`
}

type Requirement

type Requirement struct {
	Name string `json:"name"`
	Link string `json:"link,omitempty"`
}

type RunAction

type RunAction struct {
	Extension string         `json:"extension,omitempty"`
	Command   string         `json:"command,omitempty"`
	Params    map[string]any `json:"params,omitempty"`
	Reload    bool           `json:"reload,omitempty"`
	Exit      bool           `json:"exit,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL