Documentation
¶
Index ¶
Constants ¶
View Source
const ( CopyAction = "copy" OpenAction = "open" PushAction = "push" RunAction = "run" ExitAction = "exit" ReloadAction = "reload" )
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 string `json:"page,omitempty"`
// run
Command *Command `json:"command,omitempty"`
OnSuccess OnSuccessType `json:"onSuccess,omitempty"`
}
func NewCopyAction ¶ added in v0.9.13
func NewOpenAction ¶ added in v0.9.13
func NewPushAction ¶ added in v0.9.13
func NewRunAction ¶ added in v0.9.13
func NewRunAction(title string, onSuccess OnSuccessType, args ...string) Action
type ActionType ¶
type ActionType string
type Command ¶ added in v0.9.0
type Command struct {
Args []string `json:"args"`
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"`
// 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"`
}
type OnSuccessType ¶
type OnSuccessType string
var ( OpenOnSuccess OnSuccessType = "open" PushOnSuccess OnSuccessType = "push" ExitOnSuccess OnSuccessType = "exit" ReloadOnSuccess OnSuccessType = "reload" CopyOnSuccess OnSuccessType = "copy" )
type Page ¶
type Page struct {
Type PageType `json:"type"`
Title string `json:"title,omitempty"`
Actions []Action `json:"actions,omitempty"`
// Form page
SubmitAction *Action `json:"submitAction,omitempty"`
// Detail page
Preview *Preview `json:"preview,omitempty"`
// List page
ShowPreview bool `json:"showPreview,omitempty"`
EmptyView *struct {
Text string `json:"text,omitempty"`
Actions []Action `json:"actions,omitempty"`
} `json:"emptyView,omitempty"`
Items []ListItem `json:"items,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.