diff --git a/addons/embedres/embedres.go b/addons/embedres/embedres.go new file mode 100644 index 0000000..a5156fe --- /dev/null +++ b/addons/embedres/embedres.go @@ -0,0 +1,24 @@ +package embedres + +import ( + "embed" + "io" + + "opslag.de/schobers/zntg/ui" +) + +var _ ui.Resources = &resources{} + +type resources struct { + fs embed.FS +} + +func New(fs embed.FS) ui.Resources { + return &resources{fs} +} + +func (r resources) Destroy() error { return nil } + +func (r resources) OpenResource(name string) (io.ReadCloser, error) { + return r.fs.Open(name) +}