meta

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 9 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(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

func (NoMeta) DeleteAttribute(_, _, _ string) error

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

func (NoMeta) DeleteAttributes(bucket, object string) error

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

func (NoMeta) ListAttributes(_, _ string) ([]string, error)

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

func (NoMeta) RetrieveAttribute(_ *os.File, _, _, _ string) ([]byte, error)

RetrieveAttribute retrieves the value of a specific attribute for an object or a bucket. always returns ErrNoSuchKey

func (NoMeta) StoreAttribute added in v1.0.10

func (NoMeta) StoreAttribute(_ *os.File, _, _, _ string, _ []byte) error

StoreAttribute stores the value of a specific attribute for an object or a bucket. always returns nil without storing the attribute

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

func NewSideCar(dir string) (SideCar, error)

NewSideCar creates a new SideCar metadata storer.

func (SideCar) DeleteAttribute added in v1.0.10

func (s SideCar) DeleteAttribute(bucket, object, attribute string) error

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

func (SideCar) DeleteAttributes added in v1.0.10

func (s SideCar) DeleteAttributes(bucket, object string) error

DeleteAttributes removes all attributes for an object or a bucket.

func (SideCar) ListAttributes added in v1.0.10

func (s SideCar) ListAttributes(bucket, object string) ([]string, error)

ListAttributes lists all attributes for an object or a bucket.

func (SideCar) RetrieveAttribute added in v1.0.10

func (s SideCar) RetrieveAttribute(_ *os.File, bucket, object, attribute string) ([]byte, error)

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

func (SideCar) StoreAttribute added in v1.0.10

func (s SideCar) StoreAttribute(_ *os.File, bucket, object, attribute string, value []byte) error

StoreAttribute stores the value of a specific attribute for an object or a 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(f *os.File, 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(f *os.File, 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