type.go 686 B

1234567891011121314151617181920212223242526272829
  1. package oss
  2. import "time"
  3. type OSSState struct {
  4. Size int64
  5. LastModified time.Time
  6. }
  7. type OSSPath struct {
  8. Path string
  9. IsDir bool
  10. }
  11. type OSS interface {
  12. // Save saves data into path key
  13. Save(key string, data []byte) error
  14. // Load loads data from path key
  15. Load(key string) ([]byte, error)
  16. // Exists checks if the data exists in the path key
  17. Exists(key string) (bool, error)
  18. // State gets the state of the data in the path key
  19. State(key string) (OSSState, error)
  20. // List lists all the data with the given prefix, and all the paths are absolute paths
  21. List(prefix string) ([]OSSPath, error)
  22. // Delete deletes the data in the path key
  23. Delete(key string) error
  24. }