Move stuff, keep working on authenticated fetch
All checks were successful
/ docker (push) Successful in 4m5s
All checks were successful
/ docker (push) Successful in 4m5s
This commit is contained in:
parent
f8b3a6ff06
commit
e3a97170a9
11 changed files with 81 additions and 39 deletions
19
activitypub/util.go
Normal file
19
activitypub/util.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package activitypub
|
||||
|
||||
import "strings"
|
||||
|
||||
type InvalidFullHandleError struct {
|
||||
Raw string
|
||||
}
|
||||
|
||||
func (i InvalidFullHandleError) Error() string {
|
||||
return "Invalid full handle"
|
||||
}
|
||||
|
||||
func SplitFullHandle(full string) (string, string, error) {
|
||||
splits := strings.Split(strings.TrimPrefix(full, "@"), "@")
|
||||
if len(splits) != 2 {
|
||||
return "", "", InvalidFullHandleError{full}
|
||||
}
|
||||
return splits[0], splits[1], nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue