A fork of go-ap/activitypub to make it easier to implement extensions
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Go to file
Anthony Wang 81405e14ea
Add NotEmptyChecker to overwrite default NotEmpty function
4 months ago
tests Ran gofmt -s 1 year ago
.build.yml Remove coverage push to codecov, as we no longer have access to secrets 5 months ago
.gitignore Added .coverprofile files to gitignore 5 years ago
LICENSE Folded back handlers typer functionality into the activitypub package 10 months ago
Makefile Fix CI pipeline 1 year ago
README.md Added benchmark and comment about generic On/To pair 10 months ago
activity.go Export all write* functions as JSONWrite* 7 months ago
activity_test.go Improvements to Equals methods for actor and activity 10 months ago
actor.go Export all write* functions as JSONWrite* 7 months ago
actor_test.go Improvements to Equals methods for actor and activity 10 months ago
collection.go Export all write* functions as JSONWrite* 7 months ago
collection_page.go Export all write* functions as JSONWrite* 7 months ago
collection_page_test.go Unified some more the error for invalid types 10 months ago
collection_test.go Folded back handlers typer functionality into the activitypub package 10 months ago
copy.go Added Collection related copying of properties 2 years ago
decoding_gob.go Change type of Actor.Streams to be just an item collection 1 year ago
decoding_gob_test.go More lint errors fixed 1 year ago
decoding_json.go Add NotEmptyChecker to overwrite default NotEmpty function 4 months ago
decoding_json_test.go Go fmt'ed files 1 year ago
encoding_gob.go Fix gob encoding the URL 1 year ago
encoding_gob_test.go More lint errors fixed 1 year ago
encoding_json.go Export all write* functions as JSONWrite* 7 months ago
encoding_json_test.go Export all write* functions as JSONWrite* 7 months ago
flatten.go Improve Flatten function for collections and items 1 year ago
flatten_test.go Moved the flatten functionality to this package 2 years ago
go.mod Merge remote-tracking branch 'upstream/master' 4 months ago
helpers.go Added benchmark and comment about generic On/To pair 10 months ago
helpers_test.go Reorganizing the benchmarks for To/On 10 months ago
intransitive_activity.go Export all write* functions as JSONWrite* 7 months ago
intransitive_activity_test.go Added Equals method to intransitive activity 10 months ago
iri.go Merge remote-tracking branch 'upstream/master' 4 months ago
iri_test.go Fix IRI.IsObject tests 1 year ago
item.go Fix IsNil for unrecognized types 5 months ago
item_collection.go Export all write* functions as JSONWrite* 7 months ago
item_collection_test.go Moved the flatten functionality to this package 2 years ago
item_test.go Fix ItemMatches function and adding some basic tests 2 years ago
link.go Export all write* functions as JSONWrite* 7 months ago
link_test.go Added gob Marshal/Unmarshal for Link type 1 year ago
natural_language_values.go Add some convenience functions to initialize NaturalLanguageValues properties 5 months ago
natural_language_values_test.go Adding some Format methods for custom printing of objects 10 months ago
object.go Export all write* functions as JSONWrite* 7 months ago
object_id.go Some basic tests for object ids 10 months ago
object_id_test.go Some basic tests for object ids 10 months ago
object_test.go Improvements to Equals methods for actor and activity 10 months ago
ordered_collection.go Export all write* functions as JSONWrite* 7 months ago
ordered_collection_page.go Export all write* functions as JSONWrite* 7 months ago
ordered_collection_page_test.go Unified some more the error for invalid types 10 months ago
ordered_collection_test.go Folded back handlers typer functionality into the activitypub package 10 months ago
place.go Export all write* functions as JSONWrite* 7 months ago
place_test.go Go fmt'ed files 1 year ago
profile.go Export all write* functions as JSONWrite* 7 months ago
profile_test.go Go fmt'ed files 1 year ago
question.go Export all write* functions as JSONWrite* 7 months ago
question_test.go Go fmt'ed files 1 year ago
relationship.go Export all write* functions as JSONWrite* 7 months ago
relationship_test.go Holy shit! Merged the activitystreams repo 3 years ago
tombstone.go Export all write* functions as JSONWrite* 7 months ago
tombstone_test.go Go fmt'ed files 1 year ago
typer.go More improvements to the CollectionType.Of method 5 months ago
typer_test.go Removed the collection and path typer functionality 10 months ago
types.go More lint errors fixed 1 year ago
validation.go Holy shit! Merged the activitystreams repo 3 years ago
validation_test.go Added remaining tests placeholders 4 years ago

README.md

Activity Pub for Go

MIT Licensed Build Status Test Coverage Go Report Card

Basic package for using ActivityPub API in Go.

It contains types for most of the ActivityStreams vocabulary and the ActivityPub extension. They are documented accordingly with annotations from the specification.

Usage

import "github.com/go-ap/activitypub"

Note about generics

The helper functions exposed by the package come in two flavours: explicit OnXXX and ToXXX functions corresponding to each type and, a generic pair of functions On[T] and To[T].

Before using them you should consider that the former comes with a pretty heavy performance penalty:

goos: linux
goarch: amd64
pkg: github.com/go-ap/activitypub
cpu: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Benchmark_OnT_vs_On_T/OnObject-8                    752387791       1.633 ns/op
Benchmark_OnT_vs_On_T/On_T_Object-8                   4656264     261.8   ns/op
Benchmark_OnT_vs_On_T/OnActor-8                     739833261       1.596 ns/op
Benchmark_OnT_vs_On_T/On_T_Actor-8                    4035148     301.9   ns/op
Benchmark_OnT_vs_On_T/OnActivity-8                  751173854       1.604 ns/op
Benchmark_OnT_vs_On_T/On_T_Activity-8                 4062598     285.9   ns/op
Benchmark_OnT_vs_On_T/OnIntransitiveActivity-8      675824500       1.640 ns/op
Benchmark_OnT_vs_On_T/On_T_IntransitiveActivity-8     4372798     274.1   ns/op
PASS
ok  	github.com/go-ap/activitypub	11.350s