This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / repoident / repoident.go
772 B 40 lines
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 21func (r *RepoDid) UnmarshalText(text []byte) error { 22 did, err := NewRepoDid(string(text)) 23 if err != nil { 24 return err 25 } 26 *r = did 27 return nil 28} 29 30type OwnerDid syntax.DID 31 32func (o OwnerDid) String() string { return string(o) } 33 34func NewOwnerDid(s string) (OwnerDid, error) { 35 did, err := syntax.ParseDID(s) 36 if err != nil { 37 return "", fmt.Errorf("invalid ownerDid %q: %w", s, err) 38 } 39 return OwnerDid(did), nil 40}