modulepackage
0.0.0-20240830214310-c451e1525408
Repository: https://github.com/writeas/activityserve.git
Documentation: pkg.go.dev
# README
ActivityServe
A very light ActivityPub library in go
This library was built to support the very little functions that pherephone requires. It might never be feature-complete but it's a very good point to start your activityPub journey. Take a look at activityserve-example for a simple main file that uses activityserve to post a "Hello, world" message.
For now it supports following and unfollowing users, accepting follows, announcing (boosting) other posts and this is pretty much it.
The library is still a moving target and the api is not guaranteed to be stable.
You can override the auto-accept upon follow by setting the actor.OnFollow
to a custom function.
# Functions
FormatHeaders to string for printing.
FormatJSON formats json with tabs and returns the new string.
GetActor attempts to LoadActor and if it doesn't exist creates one.
LoadActor searches the filesystem and creates an Actor from the data in <name>.json This does not preserve events so use with caution.
MakeActor creates and returns a new local actor we can act on behalf of.
NewRemoteActor returns a remoteActor which holds all the info required for an actor we want to interact with (not essentially sitting in our instance).
PrettyPrint maps.
PrettyPrintJSON does what it's name says.
ReadLines reads specific lines from a file and returns them as an array of strings.
Serve starts an http server with all the required handlers.
ServeSingleActor just simplifies the call from main so that onboarding is as easy as possible.
Setup sets our environment up.
SetupStorage creates storage.
# Structs
Actor represents a local actor we can act on behalf of.
ActorToSave is a stripped down actor representation with exported properties in order for json to be able to marshal it.
RemoteActor is a type that holds an actor that we want to interact with.