18 lines
318 B
Go
18 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,
|
||
|
}
|
||
|
}
|