Documentation ¶
Index ¶
- Constants
- Variables
- func IsResolvableKey(key string) bool
- func JoinPathParts(parts []string) string
- type Adapter
- type CreateMultiPartUploadOpts
- type HashingReader
- type Inventory
- type InventoryGenerator
- type InventoryIterator
- type InventoryObject
- type MultipartUploadCompletion
- type NoOpTranslator
- type ObjectPointer
- type Path
- type Properties
- type PutOpts
- type QualifiedKey
- type StorageType
- type UploadIDTranslator
Constants ¶
const ( HashFunctionMD5 = iota HashFunctionSHA256 )
const ( StorageTypeMem = iota StorageTypeLocal StorageTypeS3 )
const ( Separator = "/" EntryTypeTree = "tree" EntryTypeObject = "object" )
Variables ¶
var (
ErrInvalidNamespace = errors.New("invalid namespace")
)
var RootPath = NewPath("", EntryTypeTree)
Functions ¶
func IsResolvableKey ¶
IsResolvableKey returns true if a key will be resolved into the default namespace of its bucket. Resolvable keys are subject to expiry, so it errs on the side of calling keys *not* resolvable.
func JoinPathParts ¶
Types ¶
type Adapter ¶
type Adapter interface { InventoryGenerator WithContext(ctx context.Context) Adapter Put(obj ObjectPointer, sizeBytes int64, reader io.Reader, opts PutOpts) error Get(obj ObjectPointer, expectedSize int64) (io.ReadCloser, error) GetRange(obj ObjectPointer, startPosition int64, endPosition int64) (io.ReadCloser, error) GetProperties(obj ObjectPointer) (Properties, error) Remove(obj ObjectPointer) error CreateMultiPartUpload(obj ObjectPointer, r *http.Request, opts CreateMultiPartUploadOpts) (string, error) UploadPart(obj ObjectPointer, sizeBytes int64, reader io.Reader, uploadID string, partNumber int64) (string, error) AbortMultiPartUpload(obj ObjectPointer, uploadID string) error CompleteMultiPartUpload(obj ObjectPointer, uploadID string, multipartList *MultipartUploadCompletion) (*string, int64, error) // ValidateConfiguration validates an appropriate bucket // configuration and returns a validation error or nil. ValidateConfiguration(storageNamespace string) error }
type CreateMultiPartUploadOpts ¶
type CreateMultiPartUploadOpts struct {
StorageClass *string // S3 storage class
}
CreateMultiPartOpts contains optional arguments for CreateMultiPartUpload. These should be analogous to options on some underlying storage layer. Missing arguments are mapped to the default if a storage layer implements the option.
If the same CreateMultiPartUpload command is implemented multiple times with the same contents but different option values, the first supplied option value is retained.
type HashingReader ¶
type HashingReader struct { Md5 hash.Hash Sha256 hash.Hash CopiedSize int64 // contains filtered or unexported fields }
func NewHashingReader ¶
func NewHashingReader(body io.Reader, hashTypes ...int) *HashingReader
type Inventory ¶
type Inventory interface { Iterator() InventoryIterator SourceName() string InventoryURL() string }
Inventory represents a snapshot of the storage space
type InventoryGenerator ¶
type InventoryIterator ¶
type InventoryIterator interface { Next() bool Err() error Get() *InventoryObject }
type InventoryObject ¶
type MultipartUploadCompletion ¶
type MultipartUploadCompletion struct{ Part []*s3.CompletedPart }
type NoOpTranslator ¶
type NoOpTranslator struct{}
the uploadId translator is required to enable re-play of recorded requests (playback_test) the NoOp translator is the default for non-simulated runs. a playback translator is implemented in playback_test
func (*NoOpTranslator) RemoveUploadID ¶
func (d *NoOpTranslator) RemoveUploadID(_ string)
func (*NoOpTranslator) SetUploadID ¶
func (d *NoOpTranslator) SetUploadID(uploadID string) string
func (*NoOpTranslator) TranslateUploadID ¶
func (d *NoOpTranslator) TranslateUploadID(uploadID string) string
type ObjectPointer ¶
ObjectPointer is a unique identifier of an object in the object store: the store is a 1:1 mapping between pointers and objects.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (*Path) ParentPath ¶
type Properties ¶
type Properties struct {
StorageClass *string
}
Properties of an object stored on the underlying block store. Refer to the actual underlying Adapter for which properties are actually reported.
type PutOpts ¶
type PutOpts struct {
StorageClass *string // S3 storage class
}
PutOpts contains optional arguments for Put. These should be analogous to options on some underlying storage layer. Missing arguments are mapped to the default if a storage layer implements the option.
If the same Put command is implemented multiple times with the same contents but different option values, the first supplied option value is retained.
type QualifiedKey ¶
type QualifiedKey struct { StorageType StorageType StorageNamespace string Key string }
func ResolveNamespace ¶
func ResolveNamespace(defaultNamespace, key string) (QualifiedKey, error)
type StorageType ¶
type StorageType int
func GetStorageType ¶
func GetStorageType(namespaceURL *url.URL) (StorageType, error)