activitypubutil

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL