-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66cc39e
commit a0fdcf0
Showing
3 changed files
with
35 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
package storage | ||
|
||
import "time" | ||
|
||
type Object struct { | ||
Path string | ||
Content []byte | ||
LastModified time.Time | ||
} | ||
|
||
type Storage interface { | ||
// ListObject returns a list of all objects in the storage backend. | ||
ListObject(prefix string) ([]Object, error) | ||
// GetObject returns the object identified by the given identifier. | ||
GetObject(identifier string) (Object, error) | ||
// PutObject stores the data in the storage backend identified by the given identifier. | ||
PutObject(identifier string, data []byte) error | ||
// PutObjectFromPath reads the file at the given path and stores the data in the storage backend identified by the given identifier. | ||
PutObjectFromPath(path string, identifier string) error | ||
// DeleteObject deletes the object identified by the given identifier. | ||
DeleteObject(identifier string) error | ||
} |