Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RootPath defines the path corresponding of the root of a Bucket RootPath = "" // NoPrefix corresponds to ... no prefix... NoPrefix = "" )
View Source
const (
// BucketNamePrefix is the beginning of the name of the bucket for Metadata
BucketNamePrefix = "0.safescale"
)
Variables ¶
This section is empty.
Functions ¶
func BuildMetadataBucketName ¶
BuildMetadataBucketName builds the name of the bucket/stowContainer that will store metadata
func NewLocation ¶
NewLocation creates an Object Storage location based on config
Types ¶
type Bucket ¶
type Bucket interface {
// ListObjects list object names in a GetBucket
ListObjects(string, string) ([]string, fail.Error)
// Browse browses inside the GetBucket and execute a callback on each Object found
Browse(string, string, func(Object) fail.Error) fail.Error
// Clear deletes all the objects in path inside a bucket
Clear(path, prefix string) fail.Error
// CreateObject creates a new object in the bucket
CreateObject(string) (Object, fail.Error)
// InspectObject returns Object instance of an object in the GetBucket
InspectObject(string) (Object, fail.Error)
// DeleteObject delete an object from a stowContainer
DeleteObject(string) fail.Error
// ReadObject reads the content of an object
ReadObject(string, io.Writer, int64, int64) (Object, fail.Error)
// WriteObject writes into an object
WriteObject(string, io.Reader, int64, abstract.ObjectStorageItemMetadata) (Object, fail.Error)
// WriteMultiPartObject writes a lot of data into an object, cut in pieces
WriteMultiPartObject(string, io.Reader, int64, int, abstract.ObjectStorageItemMetadata) (Object, fail.Error)
// GetName returns the name of the bucket
GetName() (string, fail.Error)
// GetCount returns the number of objects in the GetBucket
GetCount(string, string) (int64, fail.Error)
// GetSize returns the total size of all objects in the bucket
GetSize(string, string) (int64, string, fail.Error)
}
Bucket interface
func NullBucket ¶
func NullBucket() Bucket
NullBucket returns a bucket instance corresponding to null value
type Config ¶
type Config struct {
Type string
EnvAuth bool
AuthVersion int
AuthURL string
EndpointType string
Endpoint string
TenantDomain string
Tenant string
Domain string
User string
Key string
SecretKey string
Region string
AvailabilityZone string
ProjectID string
Credentials string
BucketName string
DNS string
}
Config represents a tenant configuration
type Location ¶
type Location interface {
// Protocol returns the name of the Object Storage protocol corresponding used by the location
Protocol() string
Configuration() Config // returns the configuration used to create Location
// ListBuckets returns all bucket prefixed by a string given as a parameter
ListBuckets(string) ([]string, fail.Error)
// FindBucket returns true of bucket exists in stowLocation
FindBucket(string) (bool, fail.Error)
// InspectBucket returns info of the GetBucket
InspectBucket(string) (abstract.ObjectStorageBucket, fail.Error)
// CreateBucket creates a bucket
CreateBucket(string) (abstract.ObjectStorageBucket, fail.Error)
// DeleteBucket removes a bucket (need to be cleared before)
DeleteBucket(string) fail.Error
// ClearBucket empties a GetBucket
ClearBucket(string, string, string) fail.Error
// ListObjects lists the objects in a GetBucket
ListObjects(string, string, string) ([]string, fail.Error)
// InspectObject ...
InspectObject(string, string) (abstract.ObjectStorageItem, fail.Error)
// ReadObject ...
ReadObject(string, string, io.Writer, int64, int64) fail.Error
// WriteMultiPartObject ...
WriteMultiPartObject(string, string, io.Reader, int64, int, abstract.ObjectStorageItemMetadata) (abstract.ObjectStorageItem, fail.Error)
// WriteObject ...
WriteObject(string, string, io.Reader, int64, abstract.ObjectStorageItemMetadata) (abstract.ObjectStorageItem, fail.Error)
// DeleteObject delete an object from a stowContainer
DeleteObject(string, string) fail.Error
}
Location ...
type Object ¶
type Object interface {
Stored() bool
Read(io.Writer, int64, int64) fail.Error
Write(io.Reader, int64) fail.Error
WriteMultiPart(io.Reader, int64, int) fail.Error
Reload() fail.Error
Delete() fail.Error
AddMetadata(abstract.ObjectStorageItemMetadata) fail.Error
ForceAddMetadata(abstract.ObjectStorageItemMetadata) fail.Error
ReplaceMetadata(abstract.ObjectStorageItemMetadata) fail.Error
GetID() (string, fail.Error)
GetName() (string, fail.Error)
GetLastUpdate() (time.Time, fail.Error)
GetSize() (int64, fail.Error)
GetETag() (string, fail.Error)
GetMetadata() (abstract.ObjectStorageItemMetadata, fail.Error)
}
Object interface
Click to show internal directories.
Click to hide internal directories.