storagespace

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 5 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 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>!<opaqueid>

func FormatStorageID

func FormatStorageID(providerID, spaceID string) string

FormatStorageID converts the provider ID and space ID into the string format. The result format will look like: <providerid>$<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, 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: <providerid>$<spaceid>!<nodeid> -> <providerid>$<spaceid>, <nodeid> <providerid>$<spaceid> -> <providerid>$<spaceid>, <spaceid> <spaceid> -> <spaceid>, <spaceid>

func SplitStorageID

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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