This repository has no description
1package repoident
2
3import (
4 "fmt"
5
6 "github.com/bluesky-social/indigo/atproto/syntax"
7)
8
9type RepoDid syntax.DID
10
11func (r RepoDid) String() string { return string(r) }
12
13func NewRepoDid(s string) (RepoDid, error) {
14 did, err := syntax.ParseDID(s)
15 if err != nil {
16 return "", fmt.Errorf("invalid repoDid %q: %w", s, err)
17 }
18 return RepoDid(did), nil
19}
20
21type OwnerDid syntax.DID
22
23func (o OwnerDid) String() string { return string(o) }
24
25func NewOwnerDid(s string) (OwnerDid, error) {
26 did, err := syntax.ParseDID(s)
27 if err != nil {
28 return "", fmt.Errorf("invalid ownerDid %q: %w", s, err)
29 }
30 return OwnerDid(did), nil
31}