mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
customcontent.go constains a structure with all the custom content, methods for getting display names, subjects, etc., and a list of variables, conditionals, and placeholder values. Tests for constructX methods included in email_test.go, and all jfa-go tests can be run with make INTERNAL=off test.
30 lines
485 B
Go
30 lines
485 B
Go
package main
|
|
|
|
import (
|
|
"io/fs"
|
|
"os"
|
|
)
|
|
|
|
type genericFS interface {
|
|
fs.FS
|
|
fs.ReadDirFS
|
|
fs.ReadFileFS
|
|
}
|
|
|
|
var localFS genericFS
|
|
var langFS genericFS
|
|
|
|
type dirFS string
|
|
|
|
func (dir dirFS) Open(name string) (fs.File, error) {
|
|
return os.Open(string(dir) + "/" + name)
|
|
}
|
|
|
|
func (dir dirFS) ReadFile(name string) ([]byte, error) {
|
|
return os.ReadFile(string(dir) + "/" + name)
|
|
}
|
|
|
|
func (dir dirFS) ReadDir(name string) ([]fs.DirEntry, error) {
|
|
return os.ReadDir(string(dir) + "/" + name)
|
|
}
|