Help us shape the future of Go! Take the 2026 Go Developer Survey

storagespace

package
v2.52.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 18

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

func ContextRegisterMoveResultSlot(ctx context.Context, slot *MoveResultSlot) context.Context

ContextRegisterMoveResultSlot stores an empty slot in ctx so the handler can fill it.

func ContextRegisterSendOwnerChan

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

ContextRegisterSendOwnerChan registers a channel to send the current space owner

func ContextSendSpaceOwnerID

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

ContextSendSpaceOwnerID stores the space owner in the context.

func ContextSetMoveResult added in v2.52.0

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

ContextSetMoveResult fills the slot registered in ctx with the given result.

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

type MoveResultSlot added in v2.52.0

type MoveResultSlot struct {
	Result *storage.MoveResult
}

MoveResultSlot is a mutable container for a *storage.MoveResult.

Jump to

Keyboard shortcuts

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