type.go 634 B

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