diff --git a/internal/core/bundle_packager/bundle_packager.go b/internal/core/bundle_packager/bundle_packager.go index e3c86f6..5131db1 100644 --- a/internal/core/bundle_packager/bundle_packager.go +++ b/internal/core/bundle_packager/bundle_packager.go @@ -40,6 +40,9 @@ type BundlePackager interface { // NOTE: path is the relative path to _assets folder FetchAsset(path string) ([]byte, error) + // Assets returns a set of assets in the bundle + Assets() (map[string][]byte, error) + // ReadFile reads the file from the bundle // NOTE: path is the relative path to the root of the bundle ReadFile(path string) ([]byte, error) diff --git a/internal/core/bundle_packager/generic.go b/internal/core/bundle_packager/generic.go index 9332e6d..80e4633 100644 --- a/internal/core/bundle_packager/generic.go +++ b/internal/core/bundle_packager/generic.go @@ -178,3 +178,11 @@ func (p *GenericBundlePackager) FetchAsset(path string) ([]byte, error) { return asset.Bytes(), nil } + +func (p *GenericBundlePackager) Assets() (map[string][]byte, error) { + assets := make(map[string][]byte) + for path, asset := range p.assets { + assets[path] = asset.Bytes() + } + return assets, nil +}