static/init.go

18 lines
318 B
Go
Raw Normal View History

2025-01-12 11:01:29 +00:00
package static
import "embed"
type Static struct {
prefix string
FS embed.FS
}
// NewStatic creates a new static wrapper (prefix should have trailing slash)
func NewStatic(prefix string, fs embed.FS) Static {
// todo later: support embed.FS and io/fs.FS.
return Static{
prefix: prefix,
FS: fs,
}
}