diff options
author | Robin Jarry <robin@jarry.cc> | 2023-02-02 00:48:51 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-02-20 14:40:59 +0100 |
commit | 9fa296fb762231d386db88913d1c2ea521bd813c (patch) | |
tree | 445bf6554084bb37e6aed479c9942b5afecb2149 /config/viewer.go | |
parent | 28483808727fd288b95b9dd26a716f6cf7c02b5a (diff) | |
download | aerc-9fa296fb762231d386db88913d1c2ea521bd813c.tar.gz |
templates: unify data interface
Require that all aerc template data objects implement the same
TemplateData interface.
Implement that interface in two different places:
1) state.TemplateData (renamed/moved from templates.TemplateData).
This structure (along with all its methods) needs to be decoupled
from the templates package to break the import cycle with the config
package. This allows much simpler construction of this object and
ensure that values are calculated only when requested.
2) config.dummyData (extracted from templates).
This is only used in the config package to validate user templates.
Putting it here allows also to break an import cycle.
Use state.TemplateData everywhere (including for account tabs title
rendering).
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'config/viewer.go')
0 files changed, 0 insertions, 0 deletions