zntg/addons/riceres/rice.go
Sander Schobers 67e73a8671 Resources only exposes OpenResource (and Destroy).
PhysicalResources derives from Resources and exposes FetchResource.
Made dependency specific resource addons.
Extended the available resource options (fallback, path, refactored copy).
NewRenderer provides DefaultResources to the created renderer.
2020-05-25 22:24:06 +02:00

24 lines
455 B
Go

package riceres
import (
"io"
rice "github.com/GeertJohan/go.rice"
"opslag.de/schobers/zntg/ui"
)
type riceResources struct {
*rice.Box
}
var _ ui.Resources = &riceResources{}
// New provides resources from a rice Box.
func New(box *rice.Box) ui.Resources {
return &riceResources{box}
}
func (r *riceResources) Destroy() error { return nil }
func (r *riceResources) OpenResource(name string) (io.ReadCloser, error) { return r.Box.Open(name) }