https://github.com/benpate/hannibal
ActivityPub library for Go
https://github.com/benpate/hannibal
activitypub activitystreams golang
Last synced: 4 months ago
JSON representation
ActivityPub library for Go
- Host: GitHub
- URL: https://github.com/benpate/hannibal
- Owner: benpate
- License: apache-2.0
- Created: 2023-02-10T16:56:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-29T17:17:02.000Z (over 2 years ago)
- Last Synced: 2024-05-23T04:03:10.228Z (about 2 years ago)
- Topics: activitypub, activitystreams, golang
- Language: Go
- Homepage:
- Size: 965 KB
- Stars: 24
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hannibal

[](http://pkg.go.dev/github.com/benpate/hannibal)
[](https://github.com/benpate/hannibal/releases)
[](https://github.com/benpate/hannibal/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/benpate/hannibal)
[](https://codecov.io/gh/benpate/hannibal)
## Triumphant ActivityPub for Go
Hannibal is an experimental ActivityPub library for Go. It's goal is to be a robust, idiomatic, and thoroughly documented ActivityPub implementation fits into your application without any magic or drama.
## PLEASE USE.. \*with caution
I would be honored for you to see if Hannibal works for your project. It is being used successfully in several production websites.
However, it _is_ still subject to significant breaking changes. So, please [reach out](https://mastodon.social/@benpate) and I am happy to help you get things working in your own software. And, please be prepared for the ground to shift under your feet with newer versions.
## Packages
Like the ActivityPub spec itself, Hannibal is broken into several layers:
### pub - ActivityPub client/server
https://www.w3.org/TR/activitypub/
This is not an ActivityPub framework, but a simple library that easily plugs into your existing app. Add ActivityPub behaviors to your existing handlers, and send ActivityPub messages to
### vocab - ActivityStreams Vocabulary
https://www.w3.org/TR/activitystreams-vocabulary/
The `vocab` package includes the standard ActivityStream vocabulary, including names of actions, objects and properties used in ActivityPub.
### streams - ActivityStreams data structures
https://www.w3.org/TR/activitystreams-core/
The `streams` package contains common data structures defined in the ActivityStreams spec, notably definitions for: `Document`, `Collection`, `OrderedCollection`, `CollectionPage`, and `OrderedCollectionPage`. These are used by ActivityPub to send and receive multiple records in one HTTP request.
This package also includes a lightweight wrapper around generic data structures (like `map[string]any` and `[]any`) that makes it easy to access data structures within an ActivityStreams/JSON-LD document.
### sigs - HTTP Signatures and Digests
https://datatracker.ietf.org/doc/draft-ietf-httpbis-message-signatures
The `sigs` package creates and verifies HTTP signatures and Digests.
## Pull Requests Welcome
This library is a work in progress, and will benefit from your experience reports, use cases, and contributions. If you have an idea for making this library better, send in a pull request. We're all in this together! 🐘