Documentation Wiki

Processing

The processing module contains the state machine for the processing of Activity Vocabulary activities as described in the ActivityPub specification.

Additionally there are helper functions compatible with the standard Go HTTP handlers which can wrap the logic of processing Activity requests and fetching objects from the compatible storage backends.

See its separate page containing more details and a basic processing example.

Storage modules

We provide multiple implementations of storage backends which are compatible with the processing module.

The interfaces that they need to implement are defined in the processing module.

Currently we support:

Client

Represents a module that can be used as a base for a client that interacts with ActivityPub servers.

It can be used with both OAuth2 bearer tokens for the Social API requests and HTTP-Signatures (RFC9421 and Cavage Draft versions) for the Federation Protocol.

Auth

Defines the logic for verifying HTTP-Signatures and OAuth2 compatible authorization headers for the Social API and Federation Protocol requests.

It’s using the same underlying libraries as the above client module.

Cache

A module to help with creating an in-memory cache for ActivityPub objects. It stores objects under the key of their ID.

It is used in various places where caching the objects makes sense, like the slower storage modules, or just as a memoisation mechanism.

Currently the module has no explicit method for cache invalidation or limiting the amount of space it uses, so please handle with care.

ActivityPub

The module that contains the main data types for the library, with additional helper functions to accomodate the Go versus JSON-LD type incompatibilities.

It offers developers a consistent data model that is identical to the objects defined in the Activity Vocabulary specification.

So the types that consumers of the library have to use are easily recognizable and reasoned about if they are already familiar with the specification itself.

In this module we define the default Activity Vocabulary data types as described by the ActivityStreams vocabulary, with additions made for presenting public keys for actors which are required by the server to server HTTP Signatures authorization mechanism.

The types in this module require the JSON-LD module for marshalling and unmarshalling to be compatible with other ActivityPub services, the standard library json module does not deal with the dynamic nature of the linked data properties in a correct fashion, see design decisions for details.

JSON-LD

A module to help with the JSON-LD marshalling and unmarshalling of the ActivityPub vocabulary objects. It provides the functionality to deal with the peculiarities of having dynamic values for the objects’ properties, and also adds a small convenience over dealing with the @context property that JSON-LD requires.

Errors

Has wrappers for dealing with specific errors inside our library, mostly focused around dealing with HTTP errors.