Documentation ¶
Overview ¶
storeutil contains utility functions for implementing storage backends. The store package only has dependencies on the std library (intentionally) so that clients of the store are easy to reference.
Index ¶
- Constants
- func ConvertScopeIDToResourceID(parsed resources.ID) (resources.ID, error)
- func ConvertScopeTypeToResourceType(resourceType string) (string, error)
- func ExtractStorageParts(id resources.ID) (string, string, string, string)
- func IDMatchesQuery(id resources.ID, query store.Query) bool
- func NormalizePart(part string) string
Constants ¶
const ( ScopePrefix = "scope" ResourcePrefix = "resource" )
Variables ¶
This section is empty.
Functions ¶
func ConvertScopeIDToResourceID ¶ added in v0.39.0
ConvertScopeIDToResourceID normalizes the resource ID to be consistent between scopes and resources.
For a resource id that identifies a resource, it is already in normalized form.
- eg: "/planes/radius/local/resourceGroups/my-rg/providers/Applications.Core/applications/my-app" is already normalized. - eg: "/planes/radius/local/resourceGroups/my-rg" needs normalization.
func ConvertScopeTypeToResourceType ¶ added in v0.39.0
ConvertScopeTypeToResourceType normalizes the resource type to be consistent between scopes and resources. See comments on ConvertScopeIDToResourceID for full context.
For a resource type that identifies a resource, it is already in normalized form.
- eg: "Applications.Core/applications" is already normalized. - eg: "resourceGroups" needs normalization.
func ExtractStorageParts ¶
ExtractStorageParts extracts the main components of the resource id in a way that easily supports our storage abstraction. Returns a tuple of the (prefix, rootScope, routingScope, resourceType)
func IDMatchesQuery ¶
IDMatchesQuery checks if the given ID matches the given query.
func NormalizePart ¶
NormalizePart takes in a string and returns a normalized version of it with a prefix and suffix segment separator.
Types ¶
This section is empty.