Sander Schobers
67e73a8671
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.
24 lines
455 B
Go
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) }
|