folder.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package sdk
  2. // BaseVirtualFolder defines the path for the virtual folder and the used quota limits.
  3. // The same folder can be shared among multiple users and each user can have different
  4. // quota limits or a different virtual path.
  5. type BaseVirtualFolder struct {
  6. ID int64 `json:"id"`
  7. Name string `json:"name"`
  8. MappedPath string `json:"mapped_path,omitempty"`
  9. Description string `json:"description,omitempty"`
  10. UsedQuotaSize int64 `json:"used_quota_size"`
  11. // Used quota as number of files
  12. UsedQuotaFiles int `json:"used_quota_files"`
  13. // Last quota update as unix timestamp in milliseconds
  14. LastQuotaUpdate int64 `json:"last_quota_update"`
  15. // list of usernames associated with this virtual folder
  16. Users []string `json:"users,omitempty"`
  17. // Filesystem configuration details
  18. FsConfig Filesystem `json:"filesystem"`
  19. }
  20. // VirtualFolder defines a mapping between an SFTPGo exposed virtual path and a
  21. // filesystem path outside the user home directory.
  22. // The specified paths must be absolute and the virtual path cannot be "/",
  23. // it must be a sub directory. The parent directory for the specified virtual
  24. // path must exist. SFTPGo will, by default, try to automatically create any missing
  25. // parent directory for the configured virtual folders at user login.
  26. type VirtualFolder struct {
  27. BaseVirtualFolder
  28. VirtualPath string `json:"virtual_path"`
  29. // Maximum size allowed as bytes. 0 means unlimited, -1 included in user quota
  30. QuotaSize int64 `json:"quota_size"`
  31. // Maximum number of files allowed. 0 means unlimited, -1 included in user quota
  32. QuotaFiles int `json:"quota_files"`
  33. }