Documentation ¶
Index ¶
Constants ¶
View Source
const ( CopyAction = "copy" OpenAction = "open" PushAction = "push" RunAction = "run" ExitAction = "exit" PasteAction = "paste" ReloadAction = "reload" FetchAction = "fetch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Title string `json:"title,omitempty"` Type ActionType `json:"type"` Key string `json:"key,omitempty"` Inputs []Input `json:"inputs,omitempty"` // copy Text string `json:"text,omitempty"` // open Target string `json:"target,omitempty"` // push Page *PageGenerator `json:"page,omitempty"` // fetch Request *Request `json:"request,omitempty"` // run Command *Command `json:"command,omitempty"` ReloadOnSuccess bool `json:"reloadOnSuccess,omitempty"` }
func NewCopyAction ¶ added in v0.9.13
func NewOpenAction ¶ added in v0.9.13
func NewPushAction ¶ added in v0.9.13
func NewReloadAction ¶ added in v0.9.18
func NewReloadAction() Action
type ActionType ¶
type ActionType string
type Command ¶ added in v0.9.0
type Command struct { Name string `json:"name"` Args []string `json:"args,omitempty"` Input string `json:"input,omitempty"` Dir string `json:"dir,omitempty"` }
func (*Command) UnmarshalJSON ¶ added in v0.9.0
type DropDownItem ¶ added in v0.9.0
type FormInputType ¶
type FormInputType string
const ( TextFieldInput FormInputType = "textfield" TextAreaInput FormInputType = "textarea" DropDownInput FormInputType = "dropdown" CheckboxInput FormInputType = "checkbox" )
type Input ¶ added in v0.7.0
type Input struct { Name string `json:"name"` Type FormInputType `json:"type"` Title string `json:"title"` Placeholder string `json:"placeholder,omitempty"` Default any `json:"default,omitempty"` Optional bool `json:"optional,omitempty"` // Only for dropdown Items []DropDownItem `json:"items,omitempty"` // Only for checkbox Label string `json:"label,omitempty"` TrueSubstitution string `json:"trueSubstitution,omitempty"` FalseSubstitution string `json:"falseSubstitution,omitempty"` }
func NewDropDown ¶ added in v0.9.23
func NewDropDown(name string, title string, items ...DropDownItem) Input
func NewTextAreaInput ¶ added in v0.9.23
type Page ¶
type Page struct { Type PageType `json:"type"` Title string `json:"title,omitempty"` Actions []Action `json:"actions,omitempty"` // Detail page Preview *TextOrCommandOrRequest `json:"preview,omitempty"` // List page ShowPreview bool `json:"showPreview,omitempty"` OnQueryChange *Command `json:"onQueryChange,omitempty"` EmptyView *EmptyView `json:"emptyView,omitempty"` Items []ListItem `json:"items,omitempty"` }
type PageGenerator ¶
type PageGenerator struct { Command *Command `json:"command,omitempty"` Request *Request `json:"request,omitempty"` Path string `json:"path,omitempty"` }
func (PageGenerator) MarshalJSON ¶
func (p PageGenerator) MarshalJSON() ([]byte, error)
func (*PageGenerator) UnmarshalJSON ¶
func (p *PageGenerator) UnmarshalJSON(data []byte) error
type Request ¶
type TextOrCommandOrRequest ¶
type TextOrCommandOrRequest struct { Text string `json:"text,omitempty"` Command *Command `json:"command,omitempty"` Request *Request `json:"request,omitempty"` }
func (TextOrCommandOrRequest) MarshalJSON ¶
func (p TextOrCommandOrRequest) MarshalJSON() ([]byte, error)
func (*TextOrCommandOrRequest) UnmarshalJSON ¶
func (p *TextOrCommandOrRequest) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.