linstrom/activitypub/shared/util.go
mStar f8b3a6ff06
All checks were successful
/ docker (push) Successful in 3m59s
Add debug handler for fetching a remote actor
Will be used later to add to internal db
2025-04-12 11:47:01 +02:00

19 lines
399 B
Go

package apshared
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
}