|
|
|
@ -3,7 +3,8 @@ package zones
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"io/fs" |
|
|
|
|
"os" |
|
|
|
|
|
|
|
|
|
"github.com/hack-pad/hackpadfs/os" |
|
|
|
|
|
|
|
|
|
"darvaza.org/resolver" |
|
|
|
|
) |
|
|
|
@ -104,5 +105,10 @@ func NewFS(dir fs.FS, domain string) (*Zones, error) {
|
|
|
|
|
|
|
|
|
|
// New builds a [Zones] tree using the given directory
|
|
|
|
|
func New(dir, domain string) (*Zones, error) { |
|
|
|
|
return NewFS(os.DirFS(dir), domain) |
|
|
|
|
base, err := os.NewFS().Sub(dir) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return NewFS(base, domain) |
|
|
|
|
} |
|
|
|
|