blob: f4985c90063228daa53ef5f6a33bbaa42243ab8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// ObjectStore (backend) interface
//
// Licensed under CC0 1.0 Universal:
// https://creativecommons.org/publicdomain/zero/1.0/legalcode
package objectstore
import (
"fmt"
)
type ObjectStore interface {
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,
}
}
|