From 484734ab36b06a9e6d35348e357312d99522302c Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 23 Dec 2020 12:01:05 +0100 Subject: Implemented the configuration file format --- config/menu.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 config/menu.go (limited to 'config/menu.go') diff --git a/config/menu.go b/config/menu.go new file mode 100644 index 0000000..2913be2 --- /dev/null +++ b/config/menu.go @@ -0,0 +1,23 @@ +package config + +// Menu struct describes a screen menu +type Menu struct { + // Banner is the banner to display before the menu + Banner string `yaml:"Banner"` + // XOffset is the X offset between the banner and the menu + XOffset int `yaml:"XOffset"` + // YOffset is the Y offset between the banner and the menu + YOffset int `yaml:"YOffset"` + // Commands is the list of commands in the menu + MenuEntries []MenuEntry `yaml:"MenuEntries"` +} + +// MenuEntry struct describes a menu entry +type MenuEntry struct { + // Key is the key associated with the action. We need to store it as a string because of how yaml unmarshal works + Key string `yaml:"Key"` + // Label is the text displayed on the menu + Label string `yaml:"Label"` + // Action is the action executed when the menu entry is selected + Action string `yaml:"Action"` +} -- cgit v1.2.3