tstor/fs/container.go

25 lines
482 B
Go
Raw Normal View History

2021-04-04 17:24:58 +00:00
package fs
type ContainerFs struct {
s *storage
}
func NewContainerFs(fss map[string]Filesystem) (*ContainerFs, error) {
s := newStorage(SupportedFactories)
for p, fs := range fss {
if err := s.AddFS(fs, p); err != nil {
return nil, err
}
}
return &ContainerFs{s: s}, nil
}
func (fs *ContainerFs) Open(filename string) (File, error) {
return fs.s.Get(filename)
}
func (fs *ContainerFs) ReadDir(path string) (map[string]File, error) {
2021-11-29 10:07:54 +00:00
return fs.s.Children(path)
2021-04-04 17:24:58 +00:00
}