file.go 662 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package webdav
  5. import (
  6. "io"
  7. "net/http"
  8. "os"
  9. )
  10. // TODO: comment that paths are always "/"-separated, even for Windows servers.
  11. type FileSystem interface {
  12. Mkdir(path string, perm os.FileMode) error
  13. OpenFile(path string, flag int, perm os.FileMode) (File, error)
  14. RemoveAll(path string) error
  15. Stat(path string) (os.FileInfo, error)
  16. }
  17. type File interface {
  18. http.File
  19. io.Writer
  20. }
  21. // TODO: a MemFS implementation.
  22. // TODO: a RealFS implementation, backed by the real, OS-provided file system.