Documentation
¶
Overview ¶
Package activitypubutil contains helpers for constructing ActivityPub actors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 defaults 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.