mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 09:42:34 +02:00
e8e64eff12
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
27 lines
637 B
Go
27 lines
637 B
Go
package keys
|
|
|
|
import (
|
|
"charm.land/bubbles/v2/key"
|
|
"github.com/anotherhadi/spilltea/internal/config"
|
|
)
|
|
|
|
type HistoryKeyMap struct {
|
|
DeleteEntry key.Binding
|
|
DeleteAll key.Binding
|
|
Filter key.Binding
|
|
SqlQuery key.Binding
|
|
}
|
|
|
|
func newHistoryKeyMap(cfg config.HistoryKeys) HistoryKeyMap {
|
|
return HistoryKeyMap{
|
|
DeleteEntry: binding(cfg.DeleteEntry, "delete entry"),
|
|
DeleteAll: binding(cfg.DeleteAll, "delete all"),
|
|
Filter: binding(cfg.Filter, "filter"),
|
|
SqlQuery: binding(cfg.SqlQuery, "sql query"),
|
|
}
|
|
}
|
|
|
|
func (h HistoryKeyMap) Bindings() []key.Binding {
|
|
return []key.Binding{h.DeleteEntry, h.DeleteAll}
|
|
}
|