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
453 B
Go
24 lines
453 B
Go
package aferores
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/spf13/afero"
|
|
"opslag.de/schobers/zntg/ui"
|
|
)
|
|
|
|
type aferoResources struct {
|
|
afero.Fs
|
|
}
|
|
|
|
var _ ui.Resources = &aferoResources{}
|
|
|
|
// New provides resources from a afero file system.
|
|
func New(fs afero.Fs) ui.Resources {
|
|
return &aferoResources{fs}
|
|
}
|
|
|
|
func (r *aferoResources) Destroy() error { return nil }
|
|
|
|
func (r *aferoResources) OpenResource(name string) (io.ReadCloser, error) { return r.Fs.Open(name) }
|