A fork of go-ap/activitypub to make it easier to implement extensions
This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Anthony Wang 81405e14ea
Add NotEmptyChecker to overwrite default NotEmpty function
2022-11-26 17:14:42 +00:00
tests Ran gofmt -s 2021-11-12 19:18:20 +01:00
.build.yml Remove coverage push to codecov, as we no longer have access to secrets 2022-10-30 10:15:45 +01:00
.gitignore Added .coverprofile files to gitignore 2018-04-08 23:02:50 +02:00
activity_test.go Improvements to Equals methods for actor and activity 2022-05-24 10:56:26 +02:00
activity.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
actor_test.go Improvements to Equals methods for actor and activity 2022-05-24 10:56:26 +02:00
actor.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
collection_page_test.go Unified some more the error for invalid types 2022-05-25 13:55:18 +02:00
collection_page.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
collection_test.go Folded back handlers typer functionality into the activitypub package 2022-05-30 14:02:51 +02:00
collection.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
copy.go Added Collection related copying of properties 2021-10-03 15:01:44 +02:00
decoding_gob_test.go More lint errors fixed 2021-11-12 20:05:08 +01:00
decoding_gob.go Change type of Actor.Streams to be just an item collection 2022-01-28 12:47:59 +01:00
decoding_json_test.go Go fmt'ed files 2021-11-12 18:27:28 +01:00
decoding_json.go Add NotEmptyChecker to overwrite default NotEmpty function 2022-11-26 17:14:42 +00:00
encoding_gob_test.go More lint errors fixed 2021-11-12 20:05:08 +01:00
encoding_gob.go Fix gob encoding the URL 2022-03-19 20:25:59 +01:00
encoding_json_test.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
encoding_json.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
flatten_test.go Moved the flatten functionality to this package 2021-04-03 13:43:33 +02:00
flatten.go Improve Flatten function for collections and items 2022-03-23 16:19:40 +01:00
go.mod Merge remote-tracking branch 'upstream/master' 2022-11-25 20:56:31 +00:00
helpers_test.go Reorganizing the benchmarks for To/On 2022-06-06 15:00:25 +02:00
helpers.go Added benchmark and comment about generic On/To pair 2022-06-04 16:47:31 +02:00
intransitive_activity_test.go Added Equals method to intransitive activity 2022-05-24 11:03:40 +02:00
intransitive_activity.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
iri_test.go Fix IRI.IsObject tests 2022-01-23 16:55:13 +01:00
iri.go Merge remote-tracking branch 'upstream/master' 2022-11-25 20:56:31 +00:00
item_collection_test.go Moved the flatten functionality to this package 2021-04-03 13:43:33 +02:00
item_collection.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
item_test.go Fix ItemMatches function and adding some basic tests 2021-03-27 14:06:24 +01:00
item.go Fix IsNil for unrecognized types 2022-11-04 19:01:11 +01:00
LICENSE Folded back handlers typer functionality into the activitypub package 2022-05-30 14:02:51 +02:00
link_test.go Added gob Marshal/Unmarshal for Link type 2021-12-30 19:01:15 +01:00
link.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
Makefile Fix CI pipeline 2022-03-19 20:30:00 +01:00
natural_language_values_test.go Adding some Format methods for custom printing of objects 2022-05-25 13:46:03 +02:00
natural_language_values.go Add some convenience functions to initialize NaturalLanguageValues properties 2022-11-03 14:54:37 +01:00
object_id_test.go Some basic tests for object ids 2022-06-06 13:22:54 +02:00
object_id.go Some basic tests for object ids 2022-06-06 13:22:54 +02:00
object_test.go Improvements to Equals methods for actor and activity 2022-05-24 10:56:26 +02:00
object.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
ordered_collection_page_test.go Unified some more the error for invalid types 2022-05-25 13:55:18 +02:00
ordered_collection_page.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
ordered_collection_test.go Folded back handlers typer functionality into the activitypub package 2022-05-30 14:02:51 +02:00
ordered_collection.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
place_test.go Go fmt'ed files 2021-11-12 18:27:28 +01:00
place.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
profile_test.go Go fmt'ed files 2021-11-12 18:27:28 +01:00
profile.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
question_test.go Go fmt'ed files 2021-11-12 18:27:28 +01:00
question.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
README.md Added benchmark and comment about generic On/To pair 2022-06-04 16:47:31 +02:00
relationship_test.go Holy shit! Merged the activitystreams repo 2019-12-03 17:23:59 +01:00
relationship.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
tombstone_test.go Go fmt'ed files 2021-11-12 18:27:28 +01:00
tombstone.go Export all write* functions as JSONWrite* 2022-08-20 21:27:03 -05:00
typer_test.go Removed the collection and path typer functionality 2022-05-30 14:48:13 +02:00
typer.go More improvements to the CollectionType.Of method 2022-11-04 10:48:14 +01:00
types.go More lint errors fixed 2021-11-12 20:05:08 +01:00
validation_test.go Added remaining tests placeholders 2019-08-21 22:33:18 +02:00
validation.go Holy shit! Merged the activitystreams repo 2019-12-03 17:23:59 +01:00

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