static/init.go
2025-01-12 04:01:29 -07:00

17 lines
318 B
Go

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,
}
}