aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-03-08 00:33:41 +0100
committerRobin Jarry <robin@jarry.cc>2023-03-08 00:43:05 +0100
commitc477d83f2493871b215aa2f8b2668b9b84fd6295 (patch)
treeab397640d4ba6dbe848a2f721e946f276d6daa6a /models
parent56a6ed0cf71ecf55f37e94b574c41927452abc44 (diff)
downloadaerc-c477d83f2493871b215aa2f8b2668b9b84fd6295.tar.gz
templates: add switch/case functions
This allows much shorter templates. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'models')
-rw-r--r--models/templates.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/templates.go b/models/templates.go
index 54537a31..dc984fc4 100644
--- a/models/templates.go
+++ b/models/templates.go
@@ -44,3 +44,8 @@ type TemplateData interface {
PendingKeys() string
Style(string, string) string
}
+
+type Case interface {
+ Matches(string) bool
+ Value() string
+}