schemas

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Validate added in v0.2.5

func Validate(bytes []byte) error

Types

type Action

type Action struct {
	RawTitle string     `json:"title"`
	Shortcut string     `json:"shortcut"`
	Type     ActionType `json:"type"`

	Inputs []FormInput `json:"inputs"`

	// edit
	Page string `json:"page"`

	// open
	Target string `json:"target"`

	// copy
	Text string `json:"text"`

	// run / push
	Command string   `json:"command"`
	Args    []string `json:"args"`

	// run
	OnSuccess OnSuccessType `json:"onSuccess"`
}

func (Action) Title

func (a Action) Title() string

type ActionType added in v0.4.1

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

func (*ActionType) UnmarshalJSON added in v0.4.1

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

type Detail

type Detail struct {
	Content Preview `json:"content"`
}

type FormInput

type FormInput struct {
	Name        string        `json:"name"`
	Type        FormInputType `json:"type"`
	Title       string        `json:"title"`
	Placeholder string        `json:"placeholder"`
	Default     string        `json:"default"`

	Choices []string `json:"choices"`
	Label   string   `json:"label"`
}

type FormInputType added in v0.4.1

type FormInputType int
const (
	UnknownFormInput FormInputType = iota
	TextField
	TextArea
	DropDown
)

func (*FormInputType) UnmarshalJSON added in v0.4.1

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

type List

type List struct {
	ShowPreview   bool       `json:"showPreview"`
	GenerateItems bool       `json:"generateItems"`
	Items         []ListItem `json:"items"`
}

type ListItem

type ListItem struct {
	Id          string   `json:"id"`
	Title       string   `json:"title"`
	Subtitle    string   `json:"subtitle"`
	Preview     *Preview `json:"preview"`
	Accessories []string `json:"accessories"`
	Actions     []Action `json:"actions"`
}

type OnSuccessType added in v0.4.1

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

func (*OnSuccessType) UnmarshalJSON added in v0.4.1

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

type PageType added in v0.4.1

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

func (*PageType) UnmarshalJSON added in v0.4.1

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

type Preview

type Preview struct {
	Text     string   `json:"text"`
	Language string   `json:"language"`
	Command  string   `json:"command"`
	Args     []string `json:"args"`
}

type Response

type Response struct {
	Type    PageType `json:"type"`
	Title   string   `json:"title"`
	Actions []Action `json:"actions"`

	*Detail
	*List
}

Jump to

Keyboard shortcuts

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