spaces

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatStorageSpaceID

func ConcatStorageSpaceID(storageID, spaceID string) string

func DecodeResourceID

func DecodeResourceID(raw string) (storageID, path, itemID string, ok bool)

Decode resourceID returns the components of the space ID. The resource ID is expected to be in the form of <storage_id>$base32(<path>)!<item_id>.

func DecodeSpaceID

func DecodeSpaceID(spaceId string) (string, error)

func DecodeStorageSpaceID

func DecodeStorageSpaceID(raw string) (storageID, path string, ok bool)

DecodeStorageSpaceID returns the components of the storage + space ID. This ID is expected to be in the format <storage_id>$base32(<path>).

func EncodeResourceID

func EncodeResourceID(r *provider.ResourceId) string

EncodeResourceID encodes the provided resource ID as a string, in the format <storage_id>$<space_id>!<item_id>. If space_id or opaque_id is not set on the ResourceId, then this part will not be encoded

func EncodeResourceInfo

func EncodeResourceInfo(info *provider.ResourceInfo) (spaceId string, err error)

EncodeResourceInfo encodes the provided resource ID as a string, in the format <storage_id>$<space_id>!<item_id>. If space_id is not set, it will be calculated from the path. If no path or space_id is set, an error will be returned

func EncodeSpaceID

func EncodeSpaceID(spacePath string) string

func EncodeStorageSpaceID

func EncodeStorageSpaceID(storageID, path string) string

EncodeStorageSpaceID encodes storage ID and space ID. In case of empty space ID, the path is used to create an identifier in the format <storage_id>$base32(<path>), where base32(<path>) is the space ID.

func ParseResourceID

func ParseResourceID(raw string) (*provider.ResourceId, bool)

ParseResourceID converts the encoded resource id in a CS3API ResourceId.

func PathRelativeToSpaceRoot

func PathRelativeToSpaceRoot(info *provider.ResourceInfo) (relativePath string, err error)

Returns the path relative to the space root.

func PathToSpaceID

func PathToSpaceID(path string) string

If the path given is a subfolder of a space, then the ID of that space will be returned. If it is not a subfolder, then the space-encoding (base32) of this full path will be returned.

func ResourceIdFromString

func ResourceIdFromString(s string) (*provider.ResourceId, error)

func ResourceIdToString

func ResourceIdToString(id *provider.ResourceId) string

Types

type ListStorageSpaceFilter

type ListStorageSpaceFilter struct {
	// contains filtered or unexported fields
}

func (ListStorageSpaceFilter) ByID

func (ListStorageSpaceFilter) ByOwner

func (ListStorageSpaceFilter) ByPath

func (ListStorageSpaceFilter) BySpaceType

func (f ListStorageSpaceFilter) BySpaceType(spaceType SpaceType) ListStorageSpaceFilter

func (ListStorageSpaceFilter) ByUser

func (ListStorageSpaceFilter) List

type SpaceType

type SpaceType string
const (
	SpaceTypeHome    SpaceType = "personal"
	SpaceTypeProject SpaceType = "project"
)

func (SpaceType) AsString

func (t SpaceType) AsString() string

Jump to

Keyboard shortcuts

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