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:
- storage-fs: direct filesystem storage, every activity and object corresponds to a file on disk under a folder structure that closely mimics the layout found when querying the fedbox server. It is generally meant to be used for development environments.
- storage-sqlite: a simple object storage on top of a single SQLite database.
- storage-boltdb: BoltDB is a performant key value store.
- storage-badger: another, more modern key value store.
- storage-all: a wrapper around all of the above that allows using any of them.
- storage-pg: storage on top of PostgreSQL, but still used as an object storage, similar to the the SQLite one.
- storage-sqlite/v2: a second storage on top of SQLite, but where databases are namespaced by their IRI hosts.
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.