Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SNIPPET_TBL = "snippets"
)
Functions ¶
func FilterText ¶
Types ¶
type ByCommand ¶
type ByCommand []SnippetInfo
type ByDescription ¶
type ByDescription []SnippetInfo
func (ByDescription) Len ¶
func (a ByDescription) Len() int
func (ByDescription) Less ¶
func (a ByDescription) Less(i, j int) bool
func (ByDescription) Swap ¶
func (a ByDescription) Swap(i, j int)
type ByOutput ¶
type ByOutput []SnippetInfo
type ByTimestamp ¶
type ByTimestamp []SnippetInfo
func (ByTimestamp) Len ¶
func (a ByTimestamp) Len() int
func (ByTimestamp) Less ¶
func (a ByTimestamp) Less(i, j int) bool
func (ByTimestamp) Swap ¶
func (a ByTimestamp) Swap(i, j int)
type SnippetInfo ¶
type SnippetInfo struct {
Description string `yaml:"description"`
Command string `yaml:"command"`
Timestamp int64 `yaml:"timestamp"`
Hash string `yaml:"-"`
// Not supported for now
Tag []string `yaml:"tag"`
Output string `yaml:"output"`
PromptPass string `yaml:"promptPass"`
}
func NewSnippet ¶
func NewSnippet() *SnippetInfo
type Snippets ¶
type Snippets struct {
Db *db.Storage
Logger *zerolog.Logger
Snippets []SnippetInfo `yaml:"snippets"`
}
func (*Snippets) Order ¶
func (snippets *Snippets) Order()
Order snippets regarding SortBy option defined in config yaml Prefix "-" reverses the order, default is "recency", "+<expressions>" is the same as "<expression>"
func (*Snippets) SortByTimestamp ¶
func (snippets *Snippets) SortByTimestamp()
Click to show internal directories.
Click to hide internal directories.