Documentation
¶
Overview ¶
Package favorites provides favorite commands management
Index ¶
- type FavoriteCommand
- type FavoritesManager
- func (fm *FavoritesManager) AddFavorite(fav *FavoriteCommand) error
- func (fm *FavoritesManager) GetByTag(tag string) []*FavoriteCommand
- func (fm *FavoritesManager) GetFavorite(id string) (*FavoriteCommand, error)
- func (fm *FavoritesManager) GetMostUsed(count int) []*FavoriteCommand
- func (fm *FavoritesManager) IncrementUsage(id string)
- func (fm *FavoritesManager) ListFavorites() []*FavoriteCommand
- func (fm *FavoritesManager) RemoveFavorite(id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FavoriteCommand ¶
type FavoriteCommand struct {
ID string
Name string
Command string
Description string
Tags []string
UsageCount int
LastUsed time.Time
CreatedAt time.Time
}
FavoriteCommand represents a favorite command
type FavoritesManager ¶
type FavoritesManager struct {
// contains filtered or unexported fields
}
FavoritesManager manages favorite commands
func NewFavoritesManager ¶
func NewFavoritesManager() *FavoritesManager
NewFavoritesManager creates a new favorites manager
func (*FavoritesManager) AddFavorite ¶
func (fm *FavoritesManager) AddFavorite(fav *FavoriteCommand) error
AddFavorite adds a favorite command
func (*FavoritesManager) GetByTag ¶
func (fm *FavoritesManager) GetByTag(tag string) []*FavoriteCommand
GetByTag returns favorites with a specific tag
func (*FavoritesManager) GetFavorite ¶
func (fm *FavoritesManager) GetFavorite(id string) (*FavoriteCommand, error)
GetFavorite returns a favorite by ID
func (*FavoritesManager) GetMostUsed ¶
func (fm *FavoritesManager) GetMostUsed(count int) []*FavoriteCommand
GetMostUsed returns the most used favorites
func (*FavoritesManager) IncrementUsage ¶
func (fm *FavoritesManager) IncrementUsage(id string)
IncrementUsage increments usage count
func (*FavoritesManager) ListFavorites ¶
func (fm *FavoritesManager) ListFavorites() []*FavoriteCommand
ListFavorites returns all favorites
func (*FavoritesManager) RemoveFavorite ¶
func (fm *FavoritesManager) RemoveFavorite(id string) error
RemoveFavorite removes a favorite command
Click to show internal directories.
Click to hide internal directories.