types

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 3 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" yaml:"title,omitempty"`
	Shortcut string     `json:"shortcut,omitempty" yaml:"shortcut,omitempty"`
	Type     ActionType `json:"type" yaml:"type"`

	// copy
	Text string `json:"text,omitempty" yaml:"text,omitempty"`

	// edit / open
	Path string `json:"path,omitempty" yaml:"path,omitempty"`

	// open / http
	Url string `json:"url,omitempty" yaml:"url,omitempty"`

	// http
	Method  string            `json:"method,omitempty" yaml:"method,omitempty"`
	Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
	Body    string            `json:"body,omitempty" yaml:"body,omitempty"`

	// run
	Command   string        `json:"command,omitempty" yaml:"command,omitempty"`
	Inputs    []Input       `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	OnSuccess OnSuccessType `json:"onSuccess,omitempty" yaml:"onSuccess,omitempty"`
}

type ActionType

type ActionType int
const (
	UnknownAction ActionType = iota
	CopyAction
	OpenAction
	ReadAction
	EditAction
	RunAction
	HttpAction
	ReloadAction
)

func (ActionType) MarshalJSON

func (a ActionType) MarshalJSON() ([]byte, error)

func (ActionType) MarshalYAML

func (a ActionType) MarshalYAML() (interface{}, error)

func (*ActionType) UnmarshalJSON

func (a *ActionType) UnmarshalJSON(bytes []byte) error

func (*ActionType) UnmarshalYAML

func (a *ActionType) UnmarshalYAML(node *yaml.Node) error

type Detail

type Detail struct {
	Text     string `json:"text" yaml:"text"`
	Command  string `json:"command" yaml:"command"`
	Language string `json:"language" yaml:"language"`
}

type FormInputType

type FormInputType int
const (
	UnknownFormInput FormInputType = iota
	TextFieldInput
	TextAreaInput
	DropDownInput
)

func (FormInputType) MarshalJSON

func (input FormInputType) MarshalJSON() ([]byte, error)

func (FormInputType) MarshalYAML

func (input FormInputType) MarshalYAML() (interface{}, error)

func (*FormInputType) UnmarshalJSON

func (input *FormInputType) UnmarshalJSON(bytes []byte) error

func (*FormInputType) UnmarshalYAML

func (input *FormInputType) UnmarshalYAML(value *yaml.Node) error

type Input added in v0.7.0

type Input struct {
	Name        string        `json:"name" yaml:"name"`
	Type        FormInputType `json:"type" yaml:"type"`
	Title       string        `json:"title" yaml:"title"`
	Placeholder string        `json:"placeholder,omitempty" yaml:"placeholder,omitempty"`
	Default     string        `json:"default,omitempty" yaml:"default,omitempty"`

	// Only for dropdown
	Choices []string `json:"choices,omitempty" yaml:"choices,omitempty"`
}

type ListItem

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

type OnSuccessType

type OnSuccessType int
const (
	ExitOnSuccess OnSuccessType = iota
	PushOnSuccess
	ReplaceOnSuccess
	ReloadOnSuccess
)

func (OnSuccessType) MarshalJSON

func (o OnSuccessType) MarshalJSON() ([]byte, error)

func (OnSuccessType) MarshalYAML

func (o OnSuccessType) MarshalYAML() (interface{}, error)

func (*OnSuccessType) UnmarshalJSON

func (o *OnSuccessType) UnmarshalJSON(bytes []byte) error

func (*OnSuccessType) UnmarshalYAML

func (o *OnSuccessType) UnmarshalYAML(node *yaml.Node) error

type Page

type Page struct {
	Type    PageType `json:"type" yaml:"type"`
	Title   string   `json:"title,omitempty" yaml:"title,omitempty"`
	Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty"`

	// Detail page
	Text     string `json:"text,omitempty" yaml:"text,omitempty"`
	Command  string `json:"command,omitempty" yaml:"command,omitempty"`
	Language string `json:"language,omitempty" yaml:"language,omitempty"`

	// List page
	ShowDetail    bool       `json:"showDetail,omitempty" yaml:"showDetail,omitempty"`
	GenerateItems bool       `json:"generateItems,omitempty" yaml:"generateItems,omitempty"`
	EmptyText     string     `json:"emptyText,omitempty" yaml:"emptyText,omitempty"`
	Items         []ListItem `json:"items,omitempty" yaml:"items,omitempty"`
}

type PageType

type PageType int
const (
	Unknown PageType = iota
	DetailPage
	ListPage
)

func (PageType) MarshalJSON

func (p PageType) MarshalJSON() ([]byte, error)

func (PageType) MarshalYAML

func (p PageType) MarshalYAML() (interface{}, error)

func (*PageType) UnmarshalJSON

func (p *PageType) UnmarshalJSON(b []byte) error

func (*PageType) UnmarshalYAML

func (p *PageType) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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