keyBindingsToMap converts a KeyBindings struct to a map for validation.
(kb KeyBindings)
| 268 | |
| 269 | // keyBindingsToMap converts a KeyBindings struct to a map for validation. |
| 270 | func keyBindingsToMap(kb KeyBindings) map[string]string { |
| 271 | return map[string]string{ |
| 272 | "switch_view": kb.SwitchView, |
| 273 | "switch_view_reverse": kb.SwitchViewReverse, |
| 274 | "nodes_page": kb.NodesPage, |
| 275 | "guests_page": kb.GuestsPage, |
| 276 | "tasks_page": kb.TasksPage, |
| 277 | "storage_page": kb.StoragePage, |
| 278 | "tasks_toggle_queue": kb.TasksToggleQueue, |
| 279 | "task_stop_cancel": kb.TaskStopCancel, |
| 280 | "menu": kb.Menu, |
| 281 | "global_menu": kb.GlobalMenu, |
| 282 | "shell": kb.Shell, |
| 283 | "vnc": kb.VNC, |
| 284 | "refresh": kb.Refresh, |
| 285 | "auto_refresh": kb.AutoRefresh, |
| 286 | "search": kb.Search, |
| 287 | "advanced_guest_filter": kb.AdvancedGuestFilter, |
| 288 | "help": kb.Help, |
| 289 | "quit": kb.Quit, |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // ValidateKeyBindings checks if all key specifications are valid. |
| 294 | func ValidateKeyBindings(kb KeyBindings) error { |
no outgoing calls
no test coverage detected