Documentation
¶
Overview ¶
Package slot defines the data structures for slot command storage.
Index ¶
- type Slot
- type Slots
- func (s *Slots) Add(slot Slot)
- func (s Slots) Closest(name string) string
- func (s *Slots) Delete(name string) bool
- func (s Slots) Exists(name string) bool
- func (s Slots) Get(name string) *Slot
- func (s Slots) Names() []string
- func (s Slots) Render(format string, writer io.Writer) error
- func (s Slots) Slice(from, to int) Slots
- func (s Slots) Unique() Slots
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slot ¶
type Slot struct {
// Name is the unique identifier for the slot.
Name string
// Description provides a brief explanation of the slot's purpose.
Description string `json:"description,omitempty"`
// Cmd is the command template with placeholders.
Cmd string
// Vars are default template variables for this slot.
Vars map[string]any `json:"vars,omitempty"`
// Tags are optional labels for organizing slots.
Tags []string `json:"tags,omitempty"`
}
Slot represents a saved command with metadata.
type Slots ¶
type Slots []Slot
Slots is a slice of Slot structs.
func (*Slots) Delete ¶
Delete removes the slot with the specified name, returning true if found and deleted.
func (Slots) Get ¶
Get retrieves a pointer to the slot with the specified name, or nil if not found.
func (Slots) Render ¶
Render outputs the slots in the specified format ("table" or "tsv") to the given writer.
Click to show internal directories.
Click to hide internal directories.