Documentation
¶
Overview ¶
Package embed compiles static @embed declarations to typed file references or bounded directory asset maps.
Index ¶
Constants ¶
const ( DefaultMaxTotalBytes = int64(64 << 20) DefaultMaxFiles = 4096 )
const ( ID = "embed" DefaultProvider = "flow.static" DefaultMaxBytes = int64(16 << 20) )
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
Bundle creates the standard extension bundle. The optional "root" setting names a filesystem directory and "provider" selects the xfile provider label. "max_size" bounds each file, while "max_total_size" and "max_files" bound directory embeds. No implicit process working-directory root is used.
Types ¶
type AssetDirectory ¶ added in v0.103.0
AssetDirectory maps slash-separated paths relative to the embedded directory to their file bytes.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver serves only assets declared during preprocessing. References are mapped through opaque IDs to validated relative paths and are integrity-checked on every open; bytes are bounded by maxBytes and are not retained.
func BundleWithFileResolver ¶
func BundleWithFileResolver(fsys fs.FS, provider string, maxBytes int64) (compiler.Bundle, *Resolver)
BundleWithFileResolver returns an embed bundle and its FS-backed resolver. The bundle registers the resolver so runner.BuildConfig composes it with other provider bindings automatically.