Documentation
¶
Overview ¶
Package packageasset discovers and snapshots Go embedded resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandSourceResources ¶ added in v1.1.0
ExpandSourceResources follows Go embed file/directory/glob selection. Missing literal files remain explicit so snapshot loading reports the broken contract.
Types ¶
type Resources ¶
type Resources struct {
Namespace string
Files []string
// SourceFile and Symbol come from the current Go embed declaration.
SourceFile string
Symbol string
}
func DiscoverSourceResources ¶
DiscoverSourceResources finds generated go:embed declarations in a package.
type Snapshotter ¶
Snapshotter creates a completed filesystem for one unpublished generation. Standard-library archive storage retains all bytes without fabricating embed internals.
type StaticSource ¶
type StaticSource struct {
// LocalRoot is an optional caller-owned authority selected independently of
// ContentURL. Local ContentURL must be relative to it. The caller must keep it
// open through staging and must not derive it by following configured paths.
// Nil uses the volume root for absolute paths, or cwd for relative paths.
LocalRoot *os.Root
Resources *resource.Store
ContentURL string
}
StaticSource resolves static authority once per generation. Local OS roots are confined while snapshotting; remote ContentURL keeps AFS ownership.
func (StaticSource) Snapshot ¶
func (s StaticSource) Snapshot(ctx context.Context, content *spec.StaticContent) (fs.FS, error)
Click to show internal directories.
Click to hide internal directories.