storagespace

package
v2.13.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 9

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 ContextRegisterSendOwnerChan added in v2.11.0

func ContextRegisterSendOwnerChan(ctx context.Context, ch chan<- *userpb.UserId) context.Context

ContextRegisterSendOwnerChan registers a channel to send the current space owner

func ContextSendSpaceOwnerID added in v2.11.0

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

ContextSendSpaceOwnerID stores the space owner in the context.

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 added in v2.7.0

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