storagespace

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSpaceReference signals that the space reference is invalid.
	ErrInvalidSpaceReference = errors.New("invalid storage space reference")
	// ErrInvalidSpaceID signals that the space ID is invalid.
	ErrInvalidSpaceID = errors.New("invalid storage space id")
)

Functions

func ContextGetDeleteResult

func ContextGetDeleteResult(ctx context.Context) *storage.DeleteResult

ContextGetDeleteResult returns the delete result written by the storage driver, or nil if none was set.

func ContextGetDeleteStorageSpaceResult

func ContextGetDeleteStorageSpaceResult(ctx context.Context) *storage.DeleteStorageSpaceResult

ContextGetDeleteStorageSpaceResult returns the delete-space result written by the storage driver, or nil if none was set.

func ContextGetMoveResult

func ContextGetMoveResult(ctx context.Context) *storage.MoveResult

ContextGetMoveResult returns the move result written by the storage driver, or nil if none was set.

func ContextGetSpaceOwner

func ContextGetSpaceOwner(ctx context.Context) *userpb.UserId

ContextGetSpaceOwner returns the space owner written by the storage driver, or nil if none was set.

func ContextRegisterDeleteResultSlot

func ContextRegisterDeleteResultSlot(ctx context.Context) context.Context

ContextRegisterDeleteResultSlot installs an empty slot in ctx so that the storage driver can write delete metadata via ContextSetDeleteResult and the events middleware can read it via ContextGetDeleteResult after the handler returns. Subsequent registrations are no-ops; the first registration wins.

func ContextRegisterDeleteStorageSpaceResultSlot

func ContextRegisterDeleteStorageSpaceResultSlot(ctx context.Context) context.Context

ContextRegisterDeleteStorageSpaceResultSlot installs an empty slot in ctx so that the storage driver can write delete-space metadata via ContextSetDeleteStorageSpaceResult and the events middleware can read it via ContextGetDeleteStorageSpaceResult after the handler returns. Subsequent registrations are no-ops; the first registration wins.

func ContextRegisterMoveResultSlot

func ContextRegisterMoveResultSlot(ctx context.Context) context.Context

ContextRegisterMoveResultSlot installs an empty slot in ctx so that the storage driver can write move metadata via ContextSetMoveResult and the events middleware can read it via ContextGetMoveResult after the handler returns. Subsequent registrations are no-ops; the first registration wins.

func ContextRegisterSpaceOwnerSlot

func ContextRegisterSpaceOwnerSlot(ctx context.Context) context.Context

ContextRegisterSpaceOwnerSlot installs an empty slot in ctx so that the storage driver can write the space owner via ContextSetSpaceOwner and the events middleware can read it via ContextGetSpaceOwner after the handler returns. Subsequent registrations are no-ops; the first registration wins.

func ContextSetDeleteResult

func ContextSetDeleteResult(ctx context.Context, r *storage.DeleteResult)

ContextSetDeleteResult writes r into the slot. Subsequent writes overwrite the previous value. Does nothing if no slot was registered.

func ContextSetDeleteStorageSpaceResult

func ContextSetDeleteStorageSpaceResult(ctx context.Context, r *storage.DeleteStorageSpaceResult)

ContextSetDeleteStorageSpaceResult writes r into the slot. Subsequent writes overwrite the previous value. Does nothing if no slot was registered.

func ContextSetMoveResult

func ContextSetMoveResult(ctx context.Context, r *storage.MoveResult)

ContextSetMoveResult writes r into the slot. Subsequent writes overwrite the previous value. Does nothing if no slot was registered.

func ContextSetSpaceOwner

func ContextSetSpaceOwner(ctx context.Context, id *userpb.UserId)

ContextSetSpaceOwner writes id into the slot. Subsequent writes overwrite the previous value. Does nothing if no slot was registered.

func FormatReference

func FormatReference(ref *provider.Reference) (string, error)

FormatReference will format a storage space reference into a string representation. If ref or ref.ResourceId are nil an error will be returned. The function doesn't check if all values are set. The resulting format can be:

"storage_id!opaque_id" "storage_id!opaque_id/path" "storage_id/path" "storage_id"

func FormatResourceID

func FormatResourceID(sid *provider.ResourceId) string

FormatResourceID converts a ResourceId into the string format. The result format will look like: <storageid>$<spaceid>!<opaqueid>

func FormatStorageID

func FormatStorageID(storageID, spaceID string) string

FormatStorageID converts the provider ID and space ID into the string format. The result format will look like: <storageid>$<spaceid> or <spaceid> in case the provider ID is empty.

func ParseID

func ParseID(ssid string) (provider.ResourceId, error)

ParseID parses a storage space ID and returns a storageprovider ResourceId. The accepted formats are: <providerid>$<spaceid>!<nodeid> -> <providerid>$<spaceid>, <nodeid> <providerid>$<spaceid> -> <providerid>$<spaceid>, <spaceid> <spaceid> -> <spaceid>, <spaceid>

func ParseReference

func ParseReference(sRef string) (provider.Reference, error)

ParseReference parses a string into a spaces reference. The expected format is `<providerid>$<spaceid>!<nodeid>/<path>`.

func SplitID

func SplitID(ssid string) (storageid, spaceid, nodeid string, err error)

SplitID splits a storage space ID into a provider ID and a node ID. The accepted formats results of the storage space ID and respective results are: <storageid>$<spaceid>!<nodeid> -> <storageid>, <spaceid>, <nodeid> <storageid>$<spaceid> -> <storageid>, <spaceid>, "" <spaceid> -> "", <spaceid>, ""

func SplitStorageID

func SplitStorageID(sid string) (storageID, spaceID string)

SplitStorageID splits a storage ID into the storage ID and the spaceID. The accepted formats are: <storageid>$<spaceid> -> <storageid>, <spaceid> <spaceid> -> "", <spaceid>

func UpdateLegacyResourceID

func UpdateLegacyResourceID(id *provider.ResourceId) *provider.ResourceId

UpdateLegacyResourceID checks if the given resource id contains a correct triple and will convert legacy ids without a spaceid by splitting the storageid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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