alfred

package
v0.0.0-...-32d88a2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPoolMatchBuilder

func GetPoolMatchBuilder() interfaces.Pool[MatchBuilder, *MatchBuilder]

func NewDebouncingWriter

func NewDebouncingWriter(out io.Writer) (w *debouncingWriter, err error)

func NewWriter

func NewWriter(out io.Writer, itemPool ItemPool) (w *writer, err error)

Types

type Item

type Item struct {
	Title        string         `json:"title,omitempty"`
	Arg          string         `json:"arg,omitempty"`
	Subtitle     string         `json:"subtitle,omitempty"`
	Match        *catgut.String `json:"match,omitempty"`
	Icon         ItemIcon       `json:"icon,omitempty"`
	Uid          string         `json:"uid,omitempty"`
	ItemType     string         `json:"type,omitempty"`
	QuicklookUrl string         `json:"quicklookurl,omitempty"`
	Text         ItemText       `json:"text,omitempty"`
	Mods         map[string]Mod `json:"mods,omitempty"`
}

func (*Item) Reset

func (i *Item) Reset()

type ItemIcon

type ItemIcon struct {
	Type string `json:"type,omitempty"`
	Path string `json:"path,omitempty"`
}

type ItemPool

type ItemPool struct {
	// contains filtered or unexported fields
}

func MakeItemPool

func MakeItemPool() ItemPool

func (ItemPool) Get

func (ip ItemPool) Get() *Item

func (ItemPool) Put

func (ip ItemPool) Put(i *Item)

type ItemText

type ItemText struct {
	Copy string `json:"copy,omitempty"`
}

type MatchBuilder

type MatchBuilder struct {
	bytes.Buffer
}

func NewMatchBuilder

func NewMatchBuilder() *MatchBuilder

func (*MatchBuilder) AddMatch

func (mb *MatchBuilder) AddMatch(s string)

func (*MatchBuilder) AddMatchBytes

func (mb *MatchBuilder) AddMatchBytes(s []byte)

func (*MatchBuilder) AddMatches

func (mb *MatchBuilder) AddMatches(s ...string)

func (*MatchBuilder) Bytes

func (mb *MatchBuilder) Bytes() []byte

type Mod

type Mod struct {
	Valid    bool   `json:"valid"`
	Arg      string `json:"arg"`
	Subtitle string `json:"subtitle"`
}

func (*Mod) Reset

func (i *Mod) Reset()

type Writer

type Writer interface {
	WriteItem(i *Item)
	io.Closer
}

Jump to

Keyboard shortcuts

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