{"id":19278923,"url":"https://github.com/MatejLach/activitystreams","last_synced_at":"2025-12-30T03:43:55.109Z","repository":{"id":36357320,"uuid":"193356349","full_name":"MatejLach/astreams","owner":"MatejLach","description":"ActivityStreams 2.0 encoding/decoding for Go 1.18+","archived":false,"fork":false,"pushed_at":"2024-09-30T21:30:44.000Z","size":71,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-06T12:02:58.038Z","etag":null,"topics":["activity-stream","activity-stream-verbs","activity-streams","activitypub","social-network"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/MatejLach/astreams?tab=doc","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatejLach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-23T14:14:31.000Z","updated_at":"2024-09-29T21:06:35.000Z","dependencies_parsed_at":"2024-04-11T06:06:03.881Z","dependency_job_id":"619cffeb-28bb-41ce-9b10-4db35dd6ef2a","html_url":"https://github.com/MatejLach/astreams","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":0.09523809523809523,"last_synced_commit":"e8b68237626bff618676aa9eff6937634fe8317b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatejLach%2Fastreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatejLach%2Fastreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatejLach%2Fastreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatejLach%2Fastreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatejLach","download_url":"https://codeload.github.com/MatejLach/astreams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223883712,"owners_count":17219270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activity-stream","activity-stream-verbs","activity-streams","activitypub","social-network"],"created_at":"2024-11-09T21:12:36.343Z","updated_at":"2025-12-30T03:43:55.069Z","avatar_url":"https://github.com/MatejLach.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# astreams\n\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)\n\n\u003e A *hand-crafted* implementation of the [Activity Streams 2.0](https://www.w3.org/TR/activitystreams-core) specification in **Go**, especially suitable for projects implementing [ActivityPub](https://activitypub.rocks).\n\n## Usage\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/MatejLach/astreams.svg)](https://pkg.go.dev/github.com/MatejLach/astreams#section-documentation)\n\nExample Activity Streams 2.0 object:\n\n```go\nobject := `\n{\n  \"@context\": \"https://www.w3.org/ns/activitystreams\",\n  \"summary\": \"Martin's recent activities\",\n  \"type\": \"Collection\",\n  \"totalItems\": 1,\n  \"items\" : [\n    {\n      \"type\": \"Add\",\n      \"published\": \"2011-02-10T15:04:55Z\",\n      \"generator\": \"http://example.org/activities-app\",\n      \"nameMap\": {\n        \"en\": \"Martin added a new image to his album.\",\n        \"ga\": \"Martin phost le fisean nua a albam.\"\n      },\n      \"actor\": {\n        \"type\": \"Person\",\n        \"id\": \"http://www.test.example/martin\",\n        \"name\": \"Martin Smith\",\n        \"url\": \"http://example.org/martin\",\n        \"image\": {\n          \"type\": \"Link\",\n          \"href\": \"http://example.org/martin/image\",\n          \"mediaType\": \"image/jpeg\",\n          \"width\": 250,\n          \"height\": 250\n        }\n      },\n      \"object\" : {\n        \"name\": \"My fluffy cat\",\n        \"type\": \"Image\",\n        \"id\": \"http://example.org/album/máiréad.jpg\",\n        \"preview\": {\n          \"type\": \"Link\",\n          \"href\": \"http://example.org/album/máiréad.jpg\",\n          \"mediaType\": \"image/jpeg\"\n        },\n        \"url\": [\n          {\n            \"type\": \"Link\",\n            \"href\": \"http://example.org/album/máiréad.jpg\",\n            \"mediaType\": \"image/jpeg\"\n          },\n          {\n            \"type\": \"Link\",\n            \"href\": \"http://example.org/album/máiréad.png\",\n            \"mediaType\": \"image/png\"\n          }\n        ]\n      },\n      \"target\": {\n        \"type\": \"Collection\",\n        \"id\": \"http://example.org/album/\",\n        \"nameMap\": {\n          \"en\": \"Martin's Photo Album\",\n          \"ga\": \"Grianghraif Mairtin\"\n        },\n        \"image\": {\n          \"type\": \"Link\",\n          \"href\": \"http://example.org/album/thumbnail.jpg\",\n          \"mediaType\": \"image/jpeg\"\n        }\n      }\n    }\n  ]\n}\n`\n```\n\n\u003e Unmarshaling Activity Streams 2.0 JSON objects into Go objects:\n\n```go\n// Unmarshal from AS 2.0 JSON\nvar exobj astreams.Collection\nerr := json.Unmarshal([]byte(object), \u0026exobj)\nif err != nil {\n\tlog.Println(err)\n}\n```\n↑ An example of unmarshaling into an [astreams.Collection](https://godoc.org/github.com/MatejLach/astreams#Collection) object.\n\n\u003e Marshaling Go objects into Activity Streams 2.0 JSON objects:\n\n```go\n// Marshal to AS 2.0 JSON\njsB, err := json.Marshal(\u0026exobj) // note the use of a pointer here; astreams MarshalJSON methods are defined on pointer receivers\nif err != nil {\n\tlog.Println(err)\n}\n```\n↑ Marshaling the same [astreams.Collection](https://godoc.org/github.com/MatejLach/astreams#Collection) back into the original ActivityStreams 2.0 JSON is equally as straightforward.\n\n## Contributing\n\nContributions are welcome. If you've found a bug, or have a feature request, don't hesitate to [open an issue](https://github.com/MatejLach/astreams/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatejLach%2Factivitystreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMatejLach%2Factivitystreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatejLach%2Factivitystreams/lists"}