meta

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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(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(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 XattrMeta

type XattrMeta struct{}

func (XattrMeta) DeleteAttribute

func (x XattrMeta) DeleteAttribute(bucket, object, attribute string) error

DeleteAttribute removes the value of a specific attribute for an object in a bucket.

func (XattrMeta) DeleteAttributes

func (x XattrMeta) DeleteAttributes(bucket, object string) error

DeleteAttributes is not implemented for xattr since xattrs are automatically removed when the file is deleted.

func (XattrMeta) ListAttributes

func (x XattrMeta) ListAttributes(bucket, object string) ([]string, error)

ListAttributes lists all attributes for an object in a bucket.

func (XattrMeta) RetrieveAttribute

func (x XattrMeta) RetrieveAttribute(bucket, object, attribute string) ([]byte, error)

RetrieveAttribute retrieves the value of a specific attribute for an object in a bucket.

func (XattrMeta) StoreAttribute

func (x XattrMeta) StoreAttribute(bucket, object, attribute string, value []byte) error

StoreAttribute stores the value of a specific attribute for an object in a bucket.

func (XattrMeta) Test

func (x XattrMeta) Test(path string) error

Test is a helper function to test if xattrs are supported.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL