Documentation
¶
Overview ¶
Package activitypubutil contains helpers for constructing ActivityPub actors.
Index ¶
- func ApplyLocalActorIdentifiers(actor *activitypub.Actor, base, username string)
- func BuildLocalActor(username string, baseURL string, user *storage.User, ...) *activitypub.Actor
- func DerivePreferredUsername(actor *activitypub.Actor, fallback string) string
- func MergeActorMetadata(dst, src *activitypub.Actor)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLocalActorIdentifiers ¶ added in v1.2.40
func ApplyLocalActorIdentifiers(actor *activitypub.Actor, base, username string)
ApplyLocalActorIdentifiers sets canonical local ActivityPub identifiers derived from the federation surface manifest.
func BuildLocalActor ¶
func BuildLocalActor(username string, baseURL string, user *storage.User, existing *activitypub.Actor) *activitypub.Actor
BuildLocalActor returns a sanitized ActivityPub actor for a local account. It merges existing actor data with canonical local identifiers derived from the provided username, base URL, and optional storage.User record. The returned actor is a deep copy and safe for callers to mutate.
func DerivePreferredUsername ¶
func DerivePreferredUsername(actor *activitypub.Actor, fallback string) string
DerivePreferredUsername returns the most suitable preferred username by inspecting the actor's existing fields and falling back to the provided value.
func MergeActorMetadata ¶
func MergeActorMetadata(dst, src *activitypub.Actor)
MergeActorMetadata copies metadata fields from src into dst when dst is missing values. Slice and pointer fields are cloned to avoid sharing mutable references.
Types ¶
This section is empty.