aboutsummaryrefslogtreecommitdiff
path: root/backend/general/utils.go
diff options
context:
space:
mode:
authorGuillermo Serrahima <dev@vylion.com>2026-03-18 16:17:38 +0100
committerGuillermo Serrahima <dev@vylion.com>2026-03-18 16:17:38 +0100
commit2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc (patch)
tree0ec6ce48e94b8335c3176908a487842b4b42d444 /backend/general/utils.go
parentdd61c1d6c9e084e2a1aa266a538de11c48c762bc (diff)
downloadllostre-2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc.tar.xz
llostre-2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc.zip
added profile caching
Diffstat (limited to 'backend/general/utils.go')
-rw-r--r--backend/general/utils.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/backend/general/utils.go b/backend/general/utils.go
new file mode 100644
index 0000000..fe0854a
--- /dev/null
+++ b/backend/general/utils.go
@@ -0,0 +1,16 @@
+package general
+
+import (
+ "fmt"
+ "strings"
+)
+
+func ParseURI(uri string) (repo, collection, rkey string, err error) {
+ // URI format: 'at://DID/collection/recordkey'
+ parts := strings.Split(strings.TrimPrefix(uri, "at://"), "/")
+ if len(parts) != 3 {
+ return "", "", "", fmt.Errorf("invalid URI format: %s", uri)
+ }
+
+ return parts[0], parts[1], parts[2], nil
+}