diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-03-18 16:17:38 +0100 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-03-18 16:17:38 +0100 |
| commit | 2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc (patch) | |
| tree | 0ec6ce48e94b8335c3176908a487842b4b42d444 /backend/general/utils.go | |
| parent | dd61c1d6c9e084e2a1aa266a538de11c48c762bc (diff) | |
| download | llostre-2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc.tar.xz llostre-2374ba4cc16fdb8f1c8c9f2993f93a1aede70dcc.zip | |
added profile caching
Diffstat (limited to 'backend/general/utils.go')
| -rw-r--r-- | backend/general/utils.go | 16 |
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 +} |
