diff options
Diffstat (limited to 'objectstore/objecstore.go')
| -rw-r--r-- | objectstore/objecstore.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/objectstore/objecstore.go b/objectstore/objecstore.go index 7509fad..f4985c9 100644 --- a/objectstore/objecstore.go +++ b/objectstore/objecstore.go @@ -4,8 +4,26 @@ // https://creativecommons.org/publicdomain/zero/1.0/legalcode package objectstore +import ( + "fmt" +) + type ObjectStore interface { - CreateObject(bucketId string, objectId string, content string) + CreateObject(bucketId string, objectId string, content string) error GetObject(bucketId string, objectId string) (string, error) DeleteObject(bucketId string, objectId string) error } + +type DuplicateError struct { + ObjectId string +} + +func (e *DuplicateError) Error() string { + return fmt.Sprintf("Duplicate of the '%v' object", e.ObjectId) +} + +func NewDuplicateError(objectId string) error { + return &DuplicateError{ + ObjectId: objectId, + } +} |
