top

utils/filestorage provides types for abstracting and implementing a system that stores files, including their metadata.

Each file in the system is identified by a unique ID, determined by the system at the time the file is stored.

File metadata includes such information as the size of the file, its checksum, and when it was created. Regardless of how it is stored in the system, at the abstraction level it is represented as a document.

Metadata can exist in the system without an associated file. However, every file must have a corresponding metadata doc stored in the system. A file can be added for a metadata doc that does not have one already.

The main type is the FileStorage interface. It exposes the core functionality of such a system. This includes adding/removing files, retrieving them or their metadata, and listing all files in the system.

The package also provides a basic implementation of FileStorage, available through NewFileStorage(). This implementation simply wraps two more focused systems: doc storage and raw file storage. The wrapper uses the doc storage to store the metadata and raw file storage to store the files.

The two subsystems are exposed via corresponding interfaces: DocStorage (and its specialization MetadataStorage) and RawFileStorage. While a single type could implement both, in practice they will be separate. The doc storage is responsible to generating the unique IDs. The raw file storage defers to the doc storage for any information about the file, including the ID.

Imported by 72 package(s)

  1. github.com/Altoros/juju-cloudsigma/state/backups
  2. github.com/Altoros/juju-cloudsigma/state/backups/testing
  3. github.com/Altoros/juju-vmware/state/backups
  4. github.com/Altoros/juju-vmware/state/backups/testing
  5. github.com/alesstimec/juju/state/backups
  6. github.com/alesstimec/juju/state/backups/testing
  7. github.com/axw/juju/state/backups
  8. github.com/axw/juju/state/backups/testing
  9. github.com/aznashwan/juju/state/backups
  10. github.com/aznashwan/juju/state/backups/testing
  11. github.com/binary132/juju/state/backups
  12. github.com/binary132/juju/state/backups/testing
  13. github.com/bogdanteleaga/juju/state/backups
  14. github.com/bogdanteleaga/juju/state/backups/testing
  15. github.com/cloud-green/juju/state/backups
  16. github.com/cloud-green/juju/state/backups/testing
  17. github.com/cmars/juju/state/backups
  18. github.com/cmars/juju/state/backups/testing
  19. github.com/dimitern/juju/state/backups
  20. github.com/dimitern/juju/state/backups/testing
  21. github.com/dooferlad/juju/state/backups
  22. github.com/dooferlad/juju/state/backups/testing
  23. github.com/ericsnowcurrently/juju/state/backups
  24. github.com/ericsnowcurrently/juju/state/backups/testing
  25. github.com/exekias/juju/state/backups
  26. github.com/exekias/juju/state/backups/testing
  27. github.com/frankban/juju-tmp/state/backups
  28. github.com/frankban/juju-tmp/state/backups/testing
  29. github.com/frankban/juju/state/backups
  30. github.com/frankban/juju/state/backups/testing
  31. github.com/gabriel-samfira/juju/state/backups
  32. github.com/gabriel-samfira/juju/state/backups/testing
  33. github.com/howbazaar/juju/state/backups
  34. github.com/howbazaar/juju/state/backups/testing
  35. github.com/jrwren/juju/apiserver/backups
  36. github.com/jrwren/juju/state
  37. github.com/jrwren/juju/state/backups
  38. github.com/jrwren/juju/state/backups/metadata
  39. github.com/juju/juju/state/backups
  40. github.com/juju/juju/state/backups/testing
  41. github.com/kapilt/juju/state
  42. github.com/kapilt/juju/state/backups/metadata
  43. github.com/kat-co/juju/state/backups
  44. github.com/kat-co/juju/state/backups/testing
  45. github.com/makyo/juju/state/backups
  46. github.com/makyo/juju/state/backups/testing
  47. github.com/mbruzek/juju/state/backups
  48. github.com/mbruzek/juju/state/backups/testing
  49. github.com/mwhudson/juju/state/backups
  50. github.com/mwhudson/juju/state/backups/testing
  51. github.com/natefinch/juju/state/backups
  52. github.com/natefinch/juju/state/backups/testing
  53. github.com/niedbalski/juju/state/backups
  54. github.com/niedbalski/juju/state/backups/testing
  55. github.com/stgraber/juju/state/backups
  56. github.com/stgraber/juju/state/backups/testing
  57. github.com/tasdomas/juju/state/backups
  58. github.com/tasdomas/juju/state/backups/testing
  59. github.com/tych0/juju/state/backups
  60. github.com/tych0/juju/state/backups/testing
  61. github.com/wallyworld/juju-snap/state/backups
  62. github.com/wallyworld/juju-snap/state/backups/testing
  63. github.com/wallyworld/juju/state/backups
  64. github.com/wallyworld/juju/state/backups/testing
  65. gopkg.in/natefinch/juju.v0/state/backups
  66. gopkg.in/natefinch/juju.v0/state/backups/testing
  67. gopkg.in/natefinch/juju.v1/state/backups
  68. gopkg.in/natefinch/juju.v1/state/backups/testing
  69. gopkg.in/natefinch/juju.v2/state/backups
  70. gopkg.in/natefinch/juju.v2/state/backups/testing
  71. gopkg.in/natefinch/juju.v3/state/backups
  72. gopkg.in/natefinch/juju.v3/state/backups/testing

Imported only in test by 14 package(s)

  1. github.com/aznashwan/utils/filestorage
  2. github.com/dimitern/utils/filestorage
  3. github.com/dooferlad/juju-utils/filestorage
  4. github.com/ericsnowcurrently/juju-utils/filestorage
  5. github.com/frankban/juju-utils/filestorage
  6. github.com/gabriel-samfira/utils/filestorage
  7. github.com/hoenirvili/utils/filestorage
  8. github.com/howbazaar/utils/filestorage
  9. github.com/kat-co/utils/filestorage
  10. github.com/mhilton/juju-utils/filestorage
  11. github.com/mhilton/utils/filestorage
  12. github.com/rogpeppe/juju-utils/filestorage
  13. github.com/tasdomas/utils/filestorage
  14. github.com/tych0/juju-utils/filestorage

Imports 1 package(s)

  1. github.com/juju/errors

Test imports 3 package(s)

  1. github.com/juju/testing/checkers
  2. gopkg.in/check.v1
  3. github.com/juju/testing