Documentation
¶
Index ¶
- Variables
- type MetadataStorer
- type NoMeta
- func (NoMeta) DeleteAttribute(_, _, _ string) error
- func (NoMeta) DeleteAttributes(bucket, object string) error
- func (NoMeta) ListAttributes(_, _ string) ([]string, error)
- func (NoMeta) RetrieveAttribute(_ *os.File, _, _, _ string) ([]byte, error)
- func (NoMeta) StoreAttribute(_ *os.File, _, _, _ string, _ []byte) error
- type SideCar
- func (s SideCar) DeleteAttribute(bucket, object, attribute string) error
- func (s SideCar) DeleteAttributes(bucket, object string) error
- func (s SideCar) ListAttributes(bucket, object string) ([]string, error)
- func (s SideCar) RetrieveAttribute(_ *os.File, bucket, object, attribute string) ([]byte, error)
- func (s SideCar) StoreAttribute(_ *os.File, bucket, object, attribute string, value []byte) error
- type XattrMeta
- func (x XattrMeta) DeleteAttribute(bucket, object, attribute string) error
- func (x XattrMeta) DeleteAttributes(bucket, object string) error
- func (x XattrMeta) ListAttributes(bucket, object string) ([]string, error)
- func (x XattrMeta) RetrieveAttribute(f *os.File, bucket, object, attribute string) ([]byte, error)
- func (x XattrMeta) StoreAttribute(f *os.File, bucket, object, attribute string, value []byte) error
- func (x XattrMeta) Test(path string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoSuchKey is returned when the key does not exist. ErrNoSuchKey = errors.New("no such key") )
Functions ¶
This section is empty.
Types ¶
type MetadataStorer ¶
type MetadataStorer interface {
// RetrieveAttribute retrieves the value of a specific attribute for an object or a bucket.
// Returns the value of the attribute, or an error if the attribute does not exist.
RetrieveAttribute(f *os.File, bucket, object, attribute string) ([]byte, error)
// StoreAttribute stores the value of a specific attribute for an object or a bucket.
// If attribute already exists, new attribute should replace existing.
// Returns an error if the operation fails.
StoreAttribute(f *os.File, bucket, object, attribute string, value []byte) error
// DeleteAttribute removes the value of a specific attribute for an object or a bucket.
// Returns an error if the operation fails.
DeleteAttribute(bucket, object, attribute string) error
// ListAttributes lists all attributes for an object or a bucket.
// Returns list of attribute names, or an error if the operation fails.
ListAttributes(bucket, object string) ([]string, error)
// DeleteAttributes removes all attributes for an object or a bucket.
// Returns an error if the operation fails.
DeleteAttributes(bucket, object string) error
}
MetadataStorer defines the interface for managing metadata. When object == "", the operation is on the bucket.
type NoMeta ¶ added in v1.0.10
type NoMeta struct{}
NoMeta is a metadata storer that does not store metadata. This can be useful for read only mounts where attempting to store metadata would fail.
func (NoMeta) DeleteAttribute ¶ added in v1.0.10
DeleteAttribute removes the value of a specific attribute for an object or a bucket. always returns nil without deleting the attribute
func (NoMeta) DeleteAttributes ¶ added in v1.0.10
DeleteAttributes removes all attributes for an object or a bucket. always returns nil without deleting any attributes
func (NoMeta) ListAttributes ¶ added in v1.0.10
ListAttributes lists all attributes for an object or a bucket. always returns an empty list of attributes
func (NoMeta) RetrieveAttribute ¶ added in v1.0.10
RetrieveAttribute retrieves the value of a specific attribute for an object or a bucket. always returns ErrNoSuchKey
type SideCar ¶ added in v1.0.10
type SideCar struct {
// contains filtered or unexported fields
}
SideCar is a metadata storer that uses sidecar files to store metadata.
func NewSideCar ¶ added in v1.0.10
NewSideCar creates a new SideCar metadata storer.
func (SideCar) DeleteAttribute ¶ added in v1.0.10
DeleteAttribute removes the value of a specific attribute for an object or a bucket.
func (SideCar) DeleteAttributes ¶ added in v1.0.10
DeleteAttributes removes all attributes for an object or a bucket.
func (SideCar) ListAttributes ¶ added in v1.0.10
ListAttributes lists all attributes for an object or a bucket.
func (SideCar) RetrieveAttribute ¶ added in v1.0.10
RetrieveAttribute retrieves the value of a specific attribute for an object or a bucket.
type XattrMeta ¶
type XattrMeta struct{}
func (XattrMeta) DeleteAttribute ¶
DeleteAttribute removes the value of a specific attribute for an object in a bucket.
func (XattrMeta) DeleteAttributes ¶
DeleteAttributes is not implemented for xattr since xattrs are automatically removed when the file is deleted.
func (XattrMeta) ListAttributes ¶
ListAttributes lists all attributes for an object in a bucket.
func (XattrMeta) RetrieveAttribute ¶
RetrieveAttribute retrieves the value of a specific attribute for an object in a bucket.
func (XattrMeta) StoreAttribute ¶
StoreAttribute stores the value of a specific attribute for an object in a bucket.