Go-Fed Overview

Table Of Contents

  1. Go-Fed-Project
  2. Libraries
  3. Next Steps

The Go-Fed Project

Go-Fed is a suite of libraries that lowers the barrier to writing Fediverse apps in Golang. Libraries built under the go-fed umbrella follow the philosophy of both a tech "stack" with composability" of other standards. For example, developers can choose to use a minimal amount of the ActivityPub stack and still opt to compose it with go/fed's library for HTTP Signatures, or to use the ActivityPub stack without using go/fed's HTTP Signatures library.

A visual overview:

go-fed libraries concepts JSON-LD ActivityStreams ActivityPub Other (Http Sigs, etc.) Fedi app go-fed/activity/astool (at compile time) go-fed/activity/streams go-fed/activity/pub go-fed/httpsig go-fed/apcore

Libraries

The ActivityPub stack is contained in the respository located at github.com/go-fed/activity. This is a monolithic repository containing three more libraries, in order to address different problems with generally mapping the ActivityPub spec into Golang.

ActivityPub is built on the exchange of JSON-LD data, which is not trivial to map into Golang. The astool command line tool reads RDF schema definitions in order to generate code that produces strong types that readily serialize and deserialize to and from JSON-LD. This is done at compile-time, so your federating application can safely skip using this tool. If you are interested in bringing new RDF vocabularies into go-fed, this is the tool that makes it happen.

The ActivityStreams vocabulary is the basic vocabulary of ActivityPub. It is an RDF schema, shared between peers as JSON-LD, and drives core behaviors between Federated applications. The streams library is generated by the astool to let federating apps in Golang easily and safely manipulate ActivityStreams types.

Finally, the pub library implements the barest bones behaviors required by the ActivityPub specification. It is designed around the actor model, and relies on Golang apps to implement quite a few interfaces. The default behaviors help get a new app off the ground, but veteran applications built on go-fed will find these behaviors customizable or entirely overridable.

In the future, the github.com/go-fed/apcore library will be an opinionated, heavyweight framework to really speed up the minimal code required to get a Federated app going. This is built on top of the github.com/go-fed/activity library, and offers some of the same flexibility, but also injects more of the community's de-facto standards instead of narrowly sticking to the ActivityPub specification.

An implementation of HTTP Signatures is provided by the github.com/go-fed/httpsig library. While the HTTP Signatures specification is not mentioned in the ActivityPub specification, it has been adopted by the community. It can be used independently of the other libraries in the Go-Fed suite.

Next Steps

Excited? The next step depends what you are looking for!