activitypub

package module
v0.0.0-...-5806d76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: MIT Imports: 19 Imported by: 0

README

go-activitypub

Package activitypub provides an implementation of the ActivityPub and ActivityStreams protocols, as they are used on the Fediverse, for the Go programming language.

Documentation

Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-activitypub

GoDoc

Import

To import package activitypub use import code like the following:

import "codeberg.org/reiver/go-activitypub"

Installation

To install package activitypub do the following:

GOPROXY=direct go get codeberg.org/reiver/go-activitypub

Author

Package activitypub was written by Charles Iliya Krempeaux

Documentation

Overview

JSON Marshal

To create ActivityPub/ActivityStreams-flavored JSON-LD and JSON, you can either use the General Node Types....

The General Node Types being: Accept, Activity, Add, Announce, Application, [Arrive], Article, Audio, Block, Collection, CollectionPage, Create, Delete, Dislike, Document, Event, Flag, Follow, Group, HashTag, Ignore, Image, Invite, Join, Leave, Like, Link / HRef, Listen, Mention, Move, Note, Object / ObjectID, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, Question, Reject, Read, Relationship, Remove, Service, TentativeReject, TentativeAccept, Tombstone, [Travel], Undo, Update, Video, View, etc.

For example:

var note = activitypub.Note{
	Content: opt.Something("<p>Hello world!</p>"),
}

bytes, err := activitypub.Marshal(note)

Or, alternatively, to generate ActivityPub/ActivityStreams-flavored JSON-LD and JSON, you can use the Any* Types.

The Any* Types being: AnyActivity, AnyActor, AnyCollection, AnyCollectionPage, AnyEntity, AnyImage, AnyLink, AnyNode, AnyObject, AnyRelationship.

For example:

var note = activitypub.AnyObject{
	Type:    jsonld.SomeType(activitypub.TypeNote),
	Content: opt.Something("<p>Hello world!</p>"),
}

bytes, err := activitypub.Marshal(note)

JSON Unmarshal

One way to load ActivityPub/ActivityStreams-flavored JSON-LD and JSON, is by using the Proto* functions:

For example:

protoActivity, err := activitypub.ProtoActivityUnmarshalJSON(bytes)
if nil != err {
	return err
}

switch protoActivity.(type) {
case activitypub.AnyActivity:
	//@TODO
default:
	//@TODO
}

Or, alternative, another way to load ActivityPub/ActivityStreams-flavored JSON-LD and JSON, is by using the Any* types directly.

General Node Types

If you want to unmarshal ActivityPub/ActivityStreams-flavored JSON-LD data, most of the time, you probably want to use the General Node Types. General Node Types start with the prefix "Any".

In particular: AnyActivity, AnyActor, AnyCollection, AnyCollectionPage, AnyEntity, AnyImage, AnyLink, AnyNode, AnyObject, AnyRelationship.

Although, it is perhaps easier to understand these when seen as a hierarchy:

  • AnyNode — represents something with an "id" and "type" field (which are ActivityPub's version of JSON-LD's "@id" and "@type" fields)
  • AnyEntity — also has "name", "nameMap", and "preview" fields
  • • • AnyLink — has all of fields of an ActivityPub / ActivityStreams 'Link'
  • • • AnyObject — has all of fields of an ActivityPub / ActivityStreams 'Object'
  • • • • AnyActivity — has all of fields of an ActivityPub / ActivityStreams 'Activity'
  • • • • AnyActor — has all of fields of an ActivityPub / ActivityStreams 'Actor'
  • • • • AnyCollection — has all of fields of an ActivityPub / ActivityStreams 'Collection'
  • • • • • AnyCollectionPage — has all of fields of an ActivityPub / ActivityStreams 'CollectionPage'
  • • • • AnyImage — has all of fields of an ActivityPub / ActivityStreams 'Image'
  • • • • AnyRelationship — has all of fields of an ActivityPub / ActivityStreams 'Relationship'

These are useful when you want to unmarshal ActivityPub / ActivityStreams JSON-LD into a struct.

For example:

var obj activitypub.AnyObject

err := activitypub.Unmarshal(bytes, &obj)

Or, for example:

var act activitypub.AnyActivity

err := activitypub.Unmarshal(bytes, &act)

Or, for example:

var unknown activitypub.AnyEntity

err := activitypub.Unmarshal(bytes, &unknown)

//@TODO: If unknown.Preview is not empty, then do something with unknown.Preview to show preview, since don't know how else to handle it.
//       Else, if unknown.Preview is empty, then do something with unknown.Name or unknown.NameMap. ('name' is used as a title in other places, so perhaps treat it something like that.)

Concrete Node Types

If you want to marshal a struct into JSON-LD data, most of the time, you probably want to use the concrete node types.

This package also provides concrete node types, so you do not have to set the 'type' yourself. In particular:

These are useful when you want to marshal a struct into ActivityPub / ActivityStreams JSON-LD.

For example:

var note = activitypub.Node{
	Content: opt.Something("<p>Hello world!</p>"),
}

bytes, err := activitypub.Marshal(note)

Collapsed Form Types

There is also a type that represents a collapsed form for a Link:

And, a type that represents a collapsed form for any Object type, include sub-types:

Proto* Types

The Proto* types are used to hold that type, plus any of its sub-types. For example, a ProtoLink can hold any 'Link' type or sub-type (such as 'Link', 'Mention', 'Hashtag', or even custom sub-types of 'Link').

Here is a summary of the Proto* types:

┌────────────────────────┬─────────────────────┬─────────────────┬───────────────────┐
│          File          │      Interface      │     Embeds      │      Returns      │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protonode.go           │ ProtoNode           │ (nothing)       │ AnyNode           │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protoentity.go         │ ProtoEntity         │ ProtoNode       │ AnyEntity         │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protolink.go           │ ProtoLink           │ ProtoEntity     │ AnyLink           │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protoobject.go         │ ProtoObject         │ ProtoEntity     │ AnyObject         │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protoimage.go          │ ProtoImage          │ ProtoObject     │ AnyImage          │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protoactivity.go       │ ProtoActivity       │ ProtoObject     │ AnyActivity       │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protoactor.go          │ ProtoActor          │ ProtoObject     │ AnyActor          │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protocollection.go     │ ProtoCollection     │ ProtoObject     │ AnyCollection     │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protocollectionpage.go │ ProtoCollectionPage │ ProtoCollection │ AnyCollectionPage │
├────────────────────────┼─────────────────────┼─────────────────┼───────────────────┤
│ protorelationship.go   │ ProtoRelationship   │ ProtoObject     │ AnyRelationship   │
└────────────────────────┴─────────────────────┴─────────────────┴───────────────────┘

To load a Proto* type from JSON, use the following functions:

Index

Examples

Constants

View Source
const (
	TypeAccept          = "Accept"
	TypeAdd             = "Add"
	TypeAnnounce        = "Announce"
	TypeArrive          = "Arrive"
	TypeBlock           = "Block"
	TypeCreate          = "Create"
	TypeDelete          = "Delete"
	TypeDislike         = "Dislike"
	TypeFlag            = "Flag"
	TypeFollow          = "Follow"
	TypeIgnore          = "Ignore"
	TypeInvite          = "Invite"
	TypeJoin            = "Join"
	TypeLeave           = "Leave"
	TypeLike            = "Like"
	TypeListen          = "Listen"
	TypeMove            = "Move"
	TypeOffer           = "Offer"
	TypeQuestion        = "Question"
	TypeReject          = "Reject"
	TypeRead            = "Read"
	TypeRemove          = "Remove"
	TypeTentativeReject = "TentativeReject"
	TypeTentativeAccept = "TentativeAccept"
	TypeTravel          = "Travel"
	TypeUndo            = "Undo"
	TypeUpdate          = "Update"
	TypeView            = "View"
)
View Source
const (
	TypeApplication  = "Application"
	TypeFeed         = "Feed"
	TypeGroup        = "Group"
	TypeOrganization = "Organization"
	TypePerson       = "Person"
	TypeService      = "Service"
)

ActivityPub / ActivityStreams Collection types.

You might use these constants with AnyCollection or RawCollection.

The relationship between these different types is:

  • Collection
  • • CollectionPage
  • • • OrderedCollectionPage ⬅ note that this is in the tree twice due to multiple-inheritance
  • • OrderedCollection
  • • • OrderedCollectionPage ⬅ note that this is in the tree twice due to multiple-inheritance
View Source
const (
	ContentTypeJSON   string = "application/activity+json"
	ContentTypeJSONLD string = `application/ld+json; profile="+JSONLDProfile+"`
)
View Source
const (
	ErrEmptyBytes  = erorr.Error("activitypub: empty bytes")
	ErrNilReceiver = erorr.Error("activitypub: nil receiver")
)
View Source
const (
	TypeHashTag = "Hashtag"
	TypeMention = "Mention"
)
View Source
const (
	// TypeArticle is used to represent an ActivityPub / ActivityStreams "Article" type.
	//
	// An "Article" is a rich-text Object sub-type that has a title stored in the "name" field.
	//
	// See also [TypeObject] ("Object") for the parent type of TypeArticle ("Article").
	//
	// The fully-qualified-value for this is:
	// https://www.w3.org/ns/activitystreams#Article
	//
	// For documentation about the ActivityPub / ActivityStreams "Article" type, see:
	// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-article
	//
	// One way you might use TypeArticle is in [AnyObject].
	// For example:
	//
	//	var obj activitypub.AnyObject
	//
	//	obj.Type = activitypub.TypeArticle
	TypeArticle = "Article"

	TypeAudio    = "Audio"    // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audio
	TypeDocument = "Document" // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-document
	TypeEvent    = "Event"    // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event
	TypeImage    = "Image"    // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-image

	// TypeObject is used to represent an ActivityPub / ActivityStreams "Object" type.
	//
	// An "Object" is a the root Object type.
	//
	// The fully-qualified-value for this is:
	// https://www.w3.org/ns/activitystreams#Object
	//
	// For documentation about the ActivityPub / ActivityStreams "Object" type, see:
	// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object
	//
	// One way you might use TypeObject is in [AnyObject].
	// For example:
	//
	//	var obj activitypub.AnyObject
	//
	//	obj.Type = activitypub.TypeObject
	TypeObject = "Object"

	// TypeNote is used to represent an ActivityPub / ActivityStreams "Note" type.
	//
	// A "Note" is a rich-text Object sub-type that doesT NOT have a title stored in the "name" field.
	//
	// See also [TypeObject] for the parent type of "Note".
	//
	// The fully-qualified-value for this is:
	// https://www.w3.org/ns/activitystreams#Note
	//
	// For documentation about the ActivityPub / ActivityStreams "Note" type, see:
	// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note
	//
	// One way you might use TypeNote is in [AnyObject].
	// For example:
	//
	//	var obj activitypub.AnyObject
	//
	//	obj.Type = activitypub.TypeNote
	TypeNote = "Note"

	TypePage         = "Page"         // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-page
	TypePlace        = "Place"        // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-place
	TypeProfile      = "Profile"      // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-profile
	TypeRelationship = "Relationship" // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-relationship
	TypeTombstone    = "Tombstone"    // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone
	TypeVideo        = "Video"        // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video
)
View Source
const (
	PublicAddressIRICanonical     = "https://www.w3.org/ns/activitystreams#Public"
	PublicAddressCompactCanonical = "as:Public"
	PublicAddressTerm             = "Public"
)
View Source
const (
	JSONLDProfile string = "https://www.w3.org/ns/activitystreams"
)
View Source
const (
	TypeActivity = "Activity"
)
View Source
const (
	TypeActor = "Actor"
)
View Source
const (
	TypeLink = "Link"
)

Variables

This section is empty.

Functions

func IsActivityPubContentType

func IsActivityPubContentType(contentType string) bool

IsActivityPubContentType returns true if an HTTP Content-Type is an ActivityPub Content-Type, and returns false otherwise.

IsActivityPubContentType accepts the following as valid ActivityPub Content-Types:

Note that according to the ActivityPub/ActivityStreams specifications "application/ld+json" is not a valid ActivityPub Content-Type, but IsActivityPubContentType accepts it because there seems to have been some Fediverse software that have produced and accepted it.

Also note that IsActivityPubContentType ignores all Content-Type parameters except "profile" with the "application/ld+json" Media-Type. So, for example, IsActivityPubContentType would return true for these, too:

  • application/activity+json; hello=world
  • application/ld+json; secretmessage=hi

Note that just checking against ContentTypeJSON and ContentTypeJSONLD won't work because certain parts of an HTTP Content-Type are case-insensitive. IsActivityPubContentType with that.

For example, these (plus more) HTTP Content-Types are all equivalent:

application/activity+json
aPpLiCaTiOn/AcTiViTy+JsOn
application/activity+JSON
application/ACTIVITY+json
APPLICATION/activity+json
APPLICATION/activity+JSON
APPLICATION/ACTIVITY+json
APPLICATION/ACTIVITY+JSON

Also, these (plus more) HTTP Content-Types are all equivalent:

application/ld+json; profile="https://www.w3.org/ns/activitystreams"
aPpLiCaTiOn/Ld+JsOn; PrOfIlE="hTtPs://WwW.w3.OrG/ns/activitystreams"
ApPlIcCtIoN/lD+jSoN; pRoFiLe="HtTpS://wWw.W3.oRg/ns/activitystreams"
APPLICATION/ld+json; profile="https://www.w3.org/ns/activitystreams"
application/LD+json; profile="https://www.w3.org/ns/activitystreams"
application/ld+JSON; profile="https://www.w3.org/ns/activitystreams"
application/ld+json; PROFILE="https://www.w3.org/ns/activitystreams"
application/ld+json; profile="HTTPS://www.w3.org/ns/activitystreams"
application/ld+json; profile="https://WWW.W3.ORG/ns/activitystreams"
APPLICATION/LD+JSON; PROFILE="HTTPS://WWW.W3.ORG/ns/activitystreams"

But these (plus more) are NOT equivalent to the previous Content-Types (or to each other):

application/ld+json; profile="https://www.w3.org/NS/activitystreams"
application/ld+json; profile="https://www.w3.org/Ns/activitystreams"
application/ld+json; profile="https://www.w3.org/nS/activitystreams"
application/ld+json; profile="https://www.w3.org/ns/ActivityStreams"
application/ld+json; profile="https://www.w3.org/ns/ACTIVITYSTREAMS"
application/ld+json; profile="https://www.w3.org/NS/ACTIVITYSTREAMS"

(URL paths are not case-insensitive.)

Which means you can NOT just use strings.ToLower() to normalize the Content-Type, but must parse it, normalize some but not all parts of it, and then reassemble it. Which is why IsActivityPubContentType exists.

func IsPublicFromJSONBytes

func IsPublicFromJSONBytes(jsonldBytes []byte) bool

IsPublicFromJSONBytes looks at raw ActivityPub JSON-LD and returns whether the "to" or "cc" fields make it public from an ActivityPub point-of-view.

func JSONIsCollectionPage

func JSONIsCollectionPage(data []byte) bool

JSONIsCollectionPage peeks at a JSON []byte and returns true if it appears to be an ActivityPub/ActivityStream 'CollectionPage' or 'OrderedCollectionPage'.

It checks if the "type" field (or "@type" field) is a known CollectionPage type ("CollectionPage", "OrderedCollectionPage").

func JSONIsLink(data []byte) bool

JSONIsLink peeks at a JSON []byte and returns true if it appears to be an ActivityPub/ActivityStream 'Link'.

It first checks if the "type" field is a known 'Link' type ("Link", "Hashtag", "Mention"). If it is one of those, it returns true. If it isn't one of those, it continues.

It next needs to deal with custom 'Link' sub-types, or 'Link' types defined after this function was written. It does that by looking for the presence of an "href" field. Technically, the "href" field is optional, but — this function makes the assumption that it will exist (as it a 'Link', including sub-types, seem useless without an "href"). Maybe that assumption will prove to be misguided in the future, but — there doesn't seem to be another way to detect if a JSON object is an ActivityPub/ActivityStream 'Link'. So, if it has an "href" field, then it returns true.

If none of those returns true, it returns false.

If you want to unmarshal JSON that looks like it is a `Link` or sub-type, then use ProtoLinkUnmarshalJSON.

func JSONType

func JSONType(data []byte) string

JSONType returns the ActivityPub/ActivityStreams 'type' of JSON.

JSONType does this by extracting the "type" (or "@type") field from a JSON object without fully unmarshaling it.

RJSONType rturns an empty string if the type cannot be determined.

func Marshal

func Marshal(values ...any) ([]byte, error)

Marshal returns the merged JSON-LD of the values passed to it.

Marshal is just a wrapper around jsonld.Marshal.

func ObjectURLFromJSONBytes

func ObjectURLFromJSONBytes(bytes []byte) []string

func ServeHTTP

func ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, activity []byte)

ServeActivity helps create an http.Handler that serves "application/activity+json".

For example:

func ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) {

	// ...

	activitypub.ServeHTTP(responseWriter, request, data)

	// ...

}

func TypeFromJSONBytes

func TypeFromJSONBytes(jsonldBytes []byte) []string

TypeFromJSONBytes looks at raw ActivityPub JSON-LD and returns the types.

It looks for both the "@type" and "type" fields.

Types

type Accept

type Accept struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Accept"`

	CoreEntity
	CoreObject
	CoreActivity
}

Accept represents an ActivityPub / ActivityStream Activity type "Accept".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept

Accept is similar to AnyObject except its `Type` field is hard-coded to "Accept".

func (Accept) ProtoActivity

func (receiver Accept) ProtoActivity() AnyActivity

func (Accept) ProtoEntity

func (receiver Accept) ProtoEntity() AnyEntity

func (Accept) ProtoNode

func (receiver Accept) ProtoNode() AnyNode

func (Accept) ProtoObject

func (receiver Accept) ProtoObject() AnyObject
func (Accept) ProtoObjectOrProtoLink()

type Activity

type Activity struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Activity"`

	CoreEntity
	CoreObject
	CoreActivity
}

Activity represents an ActivityPub / ActivityStream Activity type "Activity".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity

Activity is similar to AnyObject except its `Type` field is hard-coded to "Activity".

func (Activity) ProtoActivity

func (receiver Activity) ProtoActivity() AnyActivity

func (Activity) ProtoEntity

func (receiver Activity) ProtoEntity() AnyEntity

func (Activity) ProtoNode

func (receiver Activity) ProtoNode() AnyNode

func (Activity) ProtoObject

func (receiver Activity) ProtoObject() AnyObject
func (Activity) ProtoObjectOrProtoLink()

Activities

type Add

type Add struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Add"`

	CoreEntity
	CoreObject
	CoreActivity
}

Add represents an ActivityPub / ActivityStream Activity type "Add".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add

Add is similar to AnyObject except its `Type` field is hard-coded to "Add".

func (Add) ProtoActivity

func (receiver Add) ProtoActivity() AnyActivity

func (Add) ProtoEntity

func (receiver Add) ProtoEntity() AnyEntity

func (Add) ProtoNode

func (receiver Add) ProtoNode() AnyNode

func (Add) ProtoObject

func (receiver Add) ProtoObject() AnyObject
func (Add) ProtoObjectOrProtoLink()

type Announce

type Announce struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Announce"`

	CoreEntity
	CoreObject
	CoreActivity
}

Announce represents an ActivityPub / ActivityStream Activity type "Announce".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce

Announce is similar to AnyObject except its `Type` field is hard-coded to "Announce".

Example
var announcement activitypub.Announce

announcement.ID = jsonld.SomeID("https://mastodon.social/users/reiver/statuses/113962917187191012/activity")
announcement.Actor = activitypub.HRef("acct:reiver@mastodon.social")
announcement.Published = opt.Something("2025-02-07T14:56:43Z")
announcement.To = activitypub.SomeString("https://www.w3.org/ns/activitystreams#Public")
announcement.Object = activitypub.HRef("https://example.com/note/0xf1938e3a1a6f4ac790fdf66d1b167858")

bytes, err := jsonld.Marshal(announcement)
if nil != err {
	fmt.Printf("ERROR: %s", err)
	return
}

fmt.Printf("%s", bytes)

func (Announce) ProtoActivity

func (receiver Announce) ProtoActivity() AnyActivity

func (Announce) ProtoEntity

func (receiver Announce) ProtoEntity() AnyEntity

func (Announce) ProtoNode

func (receiver Announce) ProtoNode() AnyNode

func (Announce) ProtoObject

func (receiver Announce) ProtoObject() AnyObject
func (Announce) ProtoObjectOrProtoLink()

type AnyActivity

type AnyActivity struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreActivity
}

AnyActivity represents a general ActivityPub / ActivityStream Activity type that could be used to represent any ActivityPub / ActivityStream Activity type including sub-types.

AnyActivity is also returned by the ProtoActivity interface's [ProtoActivity.ProtoActivity] method.

AnyActivity is similar to other general types, such as: AnyActor, AnyCollection, AnyImage, AnyLink, AnyNode, AnyObject.

func (AnyActivity) IsPublic

func (receiver AnyActivity) IsPublic() bool

func (AnyActivity) ProtoActivity

func (receiver AnyActivity) ProtoActivity() AnyActivity

func (AnyActivity) ProtoEntity

func (receiver AnyActivity) ProtoEntity() AnyEntity

func (AnyActivity) ProtoNode

func (receiver AnyActivity) ProtoNode() AnyNode

func (AnyActivity) ProtoObject

func (receiver AnyActivity) ProtoObject() AnyObject
func (AnyActivity) ProtoObjectOrProtoLink()

Any Activities

func (*AnyActivity) UnmarshalJSON

func (receiver *AnyActivity) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyActivity fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyActivity has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields.

type AnyActor

type AnyActor struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreActor
}

AnyActor represents a general ActivityPub / ActivityStream Actor type that could be used to represent any ActivityPub / ActivityStream Actor type including sub-types.

AnyActor is also returned by the ProtoActor interface's [ProtoActor.ProtoActor] method.

AnyActor is similar to other general types, such as: AnyActivity, AnyCollection, AnyImage, AnyLink, AnyNode, AnyObject.

func (AnyActor) ProtoActor

func (receiver AnyActor) ProtoActor() AnyActor

func (AnyActor) ProtoEntity

func (receiver AnyActor) ProtoEntity() AnyEntity

func (AnyActor) ProtoNode

func (receiver AnyActor) ProtoNode() AnyNode

func (AnyActor) ProtoObject

func (receiver AnyActor) ProtoObject() AnyObject
func (AnyActor) ProtoObjectOrProtoLink()

Any Actors

func (*AnyActor) UnmarshalJSON

func (receiver *AnyActor) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyActor fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyActor has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields.

type AnyCollection

type AnyCollection struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreCollection
}

AnyCollection represents a general ActivityPub / ActivityStream Collection type that could be used to represent any ActivityPub / ActivityStream Collection type including sub-types.

AnyCollection is also returned by the ProtoCollection interface's [ProtoCollection.ProtoCollection] method.

AnyCollection is similar to other general types, such as: AnyActivity, AnyActor, AnyImage, AnyLink, AnyNode, AnyObject.

func (AnyCollection) ProtoCollection

func (receiver AnyCollection) ProtoCollection() AnyCollection
func (AnyCollection) ProtoCollectionOrProtoLink()

Any Collections

func (AnyCollection) ProtoEntity

func (receiver AnyCollection) ProtoEntity() AnyEntity

func (AnyCollection) ProtoNode

func (receiver AnyCollection) ProtoNode() AnyNode

func (AnyCollection) ProtoObject

func (receiver AnyCollection) ProtoObject() AnyObject
func (AnyCollection) ProtoObjectOrProtoLink()

Any Collections

func (*AnyCollection) UnmarshalJSON

func (receiver *AnyCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyCollection fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyCollection has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity, ProtoCollection, ProtoCollectionOrProtoLink) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields. For ProtoCollectionOrProtoLink fields: a JSON string unmarshals to HRef, a link-type JSON object unmarshals to AnyLink, otherwise to AnyCollection. For ProtoCollection fields: a JSON string unmarshals to AnyCollection with just an ID, a JSON object unmarshals to AnyCollection.

type AnyCollectionPage

type AnyCollectionPage struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreCollection
	CoreCollectionPage
}

AnyCollectionPage represents a general ActivityPub / ActivityStream CollectionPage type that could be used to represent any ActivityPub / ActivityStream CollectionPage type including sub-types.

AnyCollectionPage is also returned by the ProtoCollectionPage interface's [ProtoCollectionPage.ProtoCollectionPage] method.

AnyCollectionPage is similar to other general types, such as: AnyActivity, AnyActor, AnyCollection, AnyImage, AnyLink, AnyNode, AnyObject.

func (AnyCollectionPage) ProtoCollection

func (receiver AnyCollectionPage) ProtoCollection() AnyCollection
func (AnyCollectionPage) ProtoCollectionOrProtoLink()

func (AnyCollectionPage) ProtoCollectionPage

func (receiver AnyCollectionPage) ProtoCollectionPage() AnyCollectionPage
func (AnyCollectionPage) ProtoCollectionPageOrProtoLink()

func (AnyCollectionPage) ProtoEntity

func (receiver AnyCollectionPage) ProtoEntity() AnyEntity

func (AnyCollectionPage) ProtoNode

func (receiver AnyCollectionPage) ProtoNode() AnyNode

func (AnyCollectionPage) ProtoObject

func (receiver AnyCollectionPage) ProtoObject() AnyObject
func (AnyCollectionPage) ProtoObjectOrProtoLink()

func (*AnyCollectionPage) UnmarshalJSON

func (receiver *AnyCollectionPage) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyCollectionPage fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyCollectionPage has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity, ProtoCollection, ProtoCollectionOrProtoLink, ProtoCollectionPageOrProtoLink) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields. For ProtoCollectionOrProtoLink fields: a JSON string unmarshals to HRef, a link-type JSON object unmarshals to AnyLink, otherwise to AnyCollection. For ProtoCollection fields: a JSON string unmarshals to AnyCollection with just an ID, a JSON object unmarshals to AnyCollection. For ProtoCollectionPageOrProtoLink fields: a JSON string unmarshals to HRef, a link-type JSON object unmarshals to AnyLink, otherwise to AnyCollectionPage.

type AnyEntity

type AnyEntity struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
}

AnyEntity represents a general ActivityPub / ActivityStreams entity, that would be the root type that could be used to represent any ActivityPub / ActivityStreams entity type including sub-types.

AnyEntity is also returned by the ProtoEntity interface's [ProtoEntity.ProtoEntity] method.

AnyEntity is similar to other general types, such as:

func (AnyEntity) ProtoEntity

func (receiver AnyEntity) ProtoEntity() AnyEntity

func (AnyEntity) ProtoNode

func (receiver AnyEntity) ProtoNode() AnyNode

type AnyImage

type AnyImage struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreImage
}

AnyImage represents any ActivityPub / ActivityStream 'Image' type.

See also: ProtoImage.

func (AnyImage) ProtoEntity

func (receiver AnyImage) ProtoEntity() AnyEntity

func (AnyImage) ProtoImage

func (receiver AnyImage) ProtoImage() AnyImage

func (AnyImage) ProtoNode

func (receiver AnyImage) ProtoNode() AnyNode

func (AnyImage) ProtoObject

func (receiver AnyImage) ProtoObject() AnyObject
func (AnyImage) ProtoObjectOrProtoLink()

func (*AnyImage) UnmarshalJSON

func (receiver *AnyImage) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyImage fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyImage has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields.

type AnyIntransitiveActivity

type AnyIntransitiveActivity struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreActivity
}

AnyIntransitiveActivity represents a general ActivityPub / ActivityStream IntransitiveActivity type that could be used to represent any ActivityPub / ActivityStream IntransitiveActivity type including sub-types.

AnyIntransitiveActivity is also returned by the ProtoIntransitiveActivity interface's [ProtoActivity.ProtoActivity] method.

AnyIntransitiveActivity is similar to other general types, such as: AnyActor, AnyActivity, AnyCollection, AnyImage, AnyLink, AnyNode, AnyObject.

func (AnyIntransitiveActivity) ProtoActivity

func (receiver AnyIntransitiveActivity) ProtoActivity() AnyActivity

func (AnyIntransitiveActivity) ProtoEntity

func (receiver AnyIntransitiveActivity) ProtoEntity() AnyEntity

func (AnyIntransitiveActivity) ProtoIntransitiveActivity

func (receiver AnyIntransitiveActivity) ProtoIntransitiveActivity() AnyIntransitiveActivity

func (AnyIntransitiveActivity) ProtoNode

func (receiver AnyIntransitiveActivity) ProtoNode() AnyNode

func (AnyIntransitiveActivity) ProtoObject

func (receiver AnyIntransitiveActivity) ProtoObject() AnyObject
type AnyLink struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreLink
}

AnyLink represents a general ActivityPub / ActivityStream Link type that could be used to represent any ActivityPub / ActivityStream Link type including sub-types.

AnyLink is also returned by the ProtoLink interface's [ProtoLink.ProtoLink] method.

AnyLink is similar to other general types, such as:

func (AnyLink) ProtoCollectionOrProtoLink()

Any Links

func (AnyLink) ProtoCollectionPageOrProtoLink()

func (AnyLink) ProtoEntity

func (receiver AnyLink) ProtoEntity() AnyEntity
func (receiver AnyLink) ProtoLink() AnyLink

func (AnyLink) ProtoNode

func (receiver AnyLink) ProtoNode() AnyNode
func (AnyLink) ProtoObjectOrProtoLink()

Any Links

func (*AnyLink) UnmarshalJSON

func (receiver *AnyLink) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyLink fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyLink has an interface-typed field (Preview ProtoEntity) that the standard json.Unmarshal cannot handle.

type AnyNode

type AnyNode struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`
}

AnyNode represents a general JSON-LD node, that would be the root type that could be used to represent any JSON-LD node type including sub-types.

AnyNode is also returned by the ProtoNode interface's [ProtoNode.ProtoNode] method.

AnyNode is similar to other general types, such as:

func (AnyNode) ProtoNode

func (receiver AnyNode) ProtoNode() AnyNode

type AnyObject

type AnyObject struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
}

AnyObject represents a general ActivityPub / ActivityStream Object type that could be used to represent any ActivityPub / ActivityStream Object type including sub-types.

AnyObject is also returned by the ProtoObject interface's [ProtoObject.ProtoObject] method.

AnyObject is similar to other general types, such as: AnyActivity, AnyActor, AnyCollection, AnyImage, AnyLink, AnyNode.

func (AnyObject) ProtoEntity

func (receiver AnyObject) ProtoEntity() AnyEntity

func (AnyObject) ProtoNode

func (receiver AnyObject) ProtoNode() AnyNode

func (AnyObject) ProtoObject

func (receiver AnyObject) ProtoObject() AnyObject
func (AnyObject) ProtoObjectOrProtoLink()

Any Objects

func (*AnyObject) UnmarshalJSON

func (receiver *AnyObject) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyObject fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyObject has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields.

type AnyOrderedCollection

type AnyOrderedCollection struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreCollection
	CoreOrderedCollection
}

func (AnyOrderedCollection) ProtoCollection

func (receiver AnyOrderedCollection) ProtoCollection() AnyCollection

func (AnyOrderedCollection) ProtoEntity

func (receiver AnyOrderedCollection) ProtoEntity() AnyEntity

func (AnyOrderedCollection) ProtoNode

func (receiver AnyOrderedCollection) ProtoNode() AnyNode

func (AnyOrderedCollection) ProtoObject

func (receiver AnyOrderedCollection) ProtoObject() AnyObject

func (AnyOrderedCollection) ProtoOrderedCollection

func (receiver AnyOrderedCollection) ProtoOrderedCollection() AnyOrderedCollection

type AnyOrderedCollectionPage

type AnyOrderedCollectionPage struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreCollection
	CoreCollectionPage
	CoreOrderedCollection
	CoreOrderedCollectionPage
}

func (AnyOrderedCollectionPage) ProtoCollection

func (receiver AnyOrderedCollectionPage) ProtoCollection() AnyCollection

func (AnyOrderedCollectionPage) ProtoCollectionPage

func (receiver AnyOrderedCollectionPage) ProtoCollectionPage() AnyCollectionPage

func (AnyOrderedCollectionPage) ProtoEntity

func (receiver AnyOrderedCollectionPage) ProtoEntity() AnyEntity

func (AnyOrderedCollectionPage) ProtoNode

func (receiver AnyOrderedCollectionPage) ProtoNode() AnyNode

func (AnyOrderedCollectionPage) ProtoObject

func (receiver AnyOrderedCollectionPage) ProtoObject() AnyObject

func (AnyOrderedCollectionPage) ProtoOrderedCollection

func (receiver AnyOrderedCollectionPage) ProtoOrderedCollection() AnyOrderedCollection

func (AnyOrderedCollectionPage) ProtoOrderedCollectionPage

func (receiver AnyOrderedCollectionPage) ProtoOrderedCollectionPage() AnyOrderedCollectionPage

type AnyQuestion

type AnyQuestion struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreActivity
	CoreQuestion
}

func (AnyQuestion) ProtoActivity

func (receiver AnyQuestion) ProtoActivity() AnyActivity

func (AnyQuestion) ProtoEntity

func (receiver AnyQuestion) ProtoEntity() AnyEntity

func (AnyQuestion) ProtoIntransitiveActivity

func (receiver AnyQuestion) ProtoIntransitiveActivity() AnyIntransitiveActivity

func (AnyQuestion) ProtoNode

func (receiver AnyQuestion) ProtoNode() AnyNode

func (AnyQuestion) ProtoObject

func (receiver AnyQuestion) ProtoObject() AnyObject

func (AnyQuestion) ProtoQuestion

func (receiver AnyQuestion) ProtoQuestion() AnyQuestion

type AnyRelationship

type AnyRelationship struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	CoreEntity
	CoreObject
	CoreRelationship
}

func (AnyRelationship) ProtoEntity

func (receiver AnyRelationship) ProtoEntity() AnyEntity

func (AnyRelationship) ProtoNode

func (receiver AnyRelationship) ProtoNode() AnyNode

func (AnyRelationship) ProtoObject

func (receiver AnyRelationship) ProtoObject() AnyObject
func (AnyRelationship) ProtoObjectOrProtoLink()

func (AnyRelationship) ProtoRelationship

func (receiver AnyRelationship) ProtoRelationship() AnyRelationship

func (*AnyRelationship) UnmarshalJSON

func (receiver *AnyRelationship) UnmarshalJSON(data []byte) error

UnmarshalJSON makes AnyRelationship fit the [json.Unmarshaler] interface.

This custom unmarshaler is needed because AnyRelationship has interface-typed fields (ProtoNode, ProtoImage, ProtoEntity, ProtoObject, ProtoObjectOrProtoLink) that the standard json.Unmarshal cannot handle.

For ProtoNode fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoImage fields: a JSON string unmarshals to an AnyImage with just an ID, a JSON object unmarshals to AnyImage. For ProtoEntity fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For ProtoObject fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject. For ProtoObjectOrProtoLink fields: a JSON string unmarshals to ObjectID, a JSON object unmarshals to AnyObject or AnyLink. For []ProtoNode fields: each element follows the same rules as ProtoNode fields.

type Application

type Application struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Application"`

	CoreEntity
	CoreObject
	CoreActor
}

Application represents an ActivityPub / ActivityStream Object type "Application".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-service

func (Application) ProtoActor

func (receiver Application) ProtoActor() AnyActor

func (Application) ProtoEntity

func (receiver Application) ProtoEntity() AnyEntity

func (Application) ProtoNode

func (receiver Application) ProtoNode() AnyNode

func (Application) ProtoObject

func (receiver Application) ProtoObject() AnyObject
func (Application) ProtoObjectOrProtoLink()

Actors

type Article

type Article struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Article"`

	CoreEntity
	CoreObject
}

Article represents an ActivityPub / ActivityStream Object type "Article".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-article

Article is similar to Object except its `Type` field is hard-coded to "Article".

func (Article) ProtoEntity

func (receiver Article) ProtoEntity() AnyEntity

func (Article) ProtoNode

func (receiver Article) ProtoNode() AnyNode

func (Article) ProtoObject

func (receiver Article) ProtoObject() AnyObject
func (Article) ProtoObjectOrProtoLink()

Objects

type Audio

type Audio struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Audio"`

	CoreEntity
	CoreObject
}

Audio represents an ActivityPub / ActivityStream Object type "Audio".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audio

func (Audio) ProtoEntity

func (receiver Audio) ProtoEntity() AnyEntity

func (Audio) ProtoNode

func (receiver Audio) ProtoNode() AnyNode

func (Audio) ProtoObject

func (receiver Audio) ProtoObject() AnyObject
func (Audio) ProtoObjectOrProtoLink()

type Block

type Block struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Block"`

	CoreEntity
	CoreObject
	CoreActivity
}

Block represents an ActivityPub / ActivityStream Activity type "Block".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block

Block is similar to AnyObject except its `Type` field is hard-coded to "Block".

func (Block) ProtoActivity

func (receiver Block) ProtoActivity() AnyActivity

func (Block) ProtoEntity

func (receiver Block) ProtoEntity() AnyEntity

func (Block) ProtoNode

func (receiver Block) ProtoNode() AnyNode

func (Block) ProtoObject

func (receiver Block) ProtoObject() AnyObject
func (Block) ProtoObjectOrProtoLink()

func (Arrive) ProtoObjectOrProtoLink() {}

type Collection

type Collection struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`                 // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-id
	Type json.Const[string] `json:"type" json.value:"Collection"` // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type

	CoreEntity
	CoreObject
	CoreCollection
}

Collection represents an ActivityPub / ActivityStream Collection type "Collection".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection

func (Collection) ProtoCollection

func (receiver Collection) ProtoCollection() AnyCollection
func (Collection) ProtoCollectionOrProtoLink()

Collections

func (Collection) ProtoEntity

func (receiver Collection) ProtoEntity() AnyEntity

func (Collection) ProtoNode

func (receiver Collection) ProtoNode() AnyNode

func (Collection) ProtoObject

func (receiver Collection) ProtoObject() AnyObject
func (Collection) ProtoObjectOrProtoLink()

Collections

type CollectionPage

type CollectionPage struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`                     // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-id
	Type json.Const[string] `json:"type" json.value:"CollectionPage"` // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type

	CoreEntity
	CoreObject
	CoreCollection
	CoreCollectionPage
}

CollectionPage represents an ActivityPub / ActivityStream CollectionPage type "CollectionPage".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collectionpage

func (CollectionPage) ProtoCollection

func (receiver CollectionPage) ProtoCollection() AnyCollection
func (CollectionPage) ProtoCollectionOrProtoLink()

func (CollectionPage) ProtoCollectionPage

func (receiver CollectionPage) ProtoCollectionPage() AnyCollectionPage
func (CollectionPage) ProtoCollectionPageOrProtoLink()

func (CollectionPage) ProtoEntity

func (receiver CollectionPage) ProtoEntity() AnyEntity

func (CollectionPage) ProtoNode

func (receiver CollectionPage) ProtoNode() AnyNode

func (CollectionPage) ProtoObject

func (receiver CollectionPage) ProtoObject() AnyObject
func (CollectionPage) ProtoObjectOrProtoLink()

type CoreActivity

type CoreActivity struct {
	Actor      ProtoNode              `json:"actor,omitempty"`
	Instrument ProtoNode              `json:"instrument,omitempty"`
	Object     ProtoObjectOrProtoLink `json:"object,omitempty"`
	Origin     ProtoNode              `json:"origin,omitempty"`
	Result     ProtoNode              `json:"result,omitempty"`
	Target     ProtoNode              `json:"target,omitempty"`
}

type CoreActor

type CoreActor struct {
	EndPoints         EndPoints            `json:"endpoints,omitempty"`
	Followers         opt.Optional[string] `json:"followers,omitempty"`
	Following         opt.Optional[string] `json:"following,omitempty"`
	InBox             opt.Optional[string] `json:"inbox,omitempty"`
	Liked             opt.Optional[string] `json:"liked,omitempty"`
	OutBox            opt.Optional[string] `json:"outbox,omitempty"`
	PreferredUserName Strings              `json:"preferredUsername,omitempty"`
}

type CoreEntity

type CoreEntity struct {
	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview ProtoEntity          `json:"preview,omitempty"`
}

type CoreImage

type CoreImage struct {
	Height opt.Optional[uint64] `json:"height,omitempty"`
	Width  opt.Optional[uint64] `json:"width,omitempty"`
}
type CoreLink struct {
	Height    WholeNumber          `json:"height,omitempty"`
	HRef      opt.Optional[string] `json:"href,omitempty"`
	HRefLang  opt.Optional[string] `json:"hreflang,omitempty"`
	MediaType opt.Optional[string] `json:"mediaType,omitempty"`
	Rel       Strings              `json:"rel,omitempty"`
	Width     WholeNumber          `json:"width,omitempty"`
}

type CoreObject

type CoreObject struct {
	AlsoKnownAs  Strings                  `json:"alsoKnownAs,omitempty"`
	Attachments  []ProtoObjectOrProtoLink `json:"attachment,omitempty"`
	AttributedTo []ProtoObjectOrProtoLink `json:"attributedTo,omitempty"`
	Audiences    []ProtoObjectOrProtoLink `json:"audience,omitempty"`
	CC           Strings                  `json:"cc,omitempty"`
	Content      opt.Optional[string]     `json:"content,omitempty"`
	ContentMap   Map                      `json:"contentMap,omitempty"`
	Duration     opt.Optional[string]     `json:"duration,omitempty"`
	EndTime      opt.Optional[string]     `json:"endTime,omitempty"`
	Generator    ProtoNode                `json:"generator,omitempty"`
	Icon         ProtoImage               `json:"icon,omitempty"`
	Image        ProtoImage               `json:"image,omitempty"`
	InReplyTo    Strings                  `json:"inReplyTo,omitempty"`
	Location     []ProtoObjectOrProtoLink `json:"location,omitempty"`
	MediaType    opt.Optional[string]     `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string]     `json:"movedTo,omitempty"`
	Published    opt.Optional[string]     `json:"published,omitempty"`
	StartTime    opt.Optional[string]     `json:"startTime,omitempty"`
	Summary      nul.Nullable[string]     `json:"summary,omitempty"`
	SummaryMap   Map                      `json:"summaryMap,omitempty"`
	Tags         []ProtoObjectOrProtoLink `json:"tag,omitempty"`
	To           Strings                  `json:"to,omitempty"`
	Updated      opt.Optional[string]     `json:"updated,omitempty"`
	URL          ProtoLink                `json:"url,omitempty"`

	Likes   ProtoCollectionOrProtoLink `json:"likes,omitempty"`
	Shares  ProtoCollectionOrProtoLink `json:"shares,omitempty"`
	Replies ProtoCollection            `json:"replies,omitempty"`
}

func (CoreObject) IsPublic

func (receiver CoreObject) IsPublic() bool

type CoreOrderedCollection

type CoreOrderedCollection struct {
	OrderedItems []ProtoObjectOrProtoLink `json:"orderedItems,omitempty"`
}

type CoreOrderedCollectionPage

type CoreOrderedCollectionPage struct {
	StartIndex opt.Optional[uint64] `json:"startIndex,omitempty"` // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-startindex
}

type CoreQuestion

type CoreQuestion struct {
	AnyOf  []ProtoObjectOrProtoLink `json:"anyOf,omitempty"`
	Closed any                      `json:"closed,omitempty"` //@TODO: should be of type: Object | Link | xsd:dateTime | xsd:boolean
	OneOf  []ProtoObjectOrProtoLink `json:"oneOf,omitempty"`
}

type CoreRelationship

type CoreRelationship struct {
	Object       ProtoObjectOrProtoLink `json:"object,omitempty"`       // https://www.w3.org/ns/activitystreams#object
	Relationship ProtoObject            `json:"relationship,omitempty"` // https://www.w3.org/ns/activitystreams#relationship
	Subject      ProtoObjectOrProtoLink `json:"subject,omitempty"`      // https://www.w3.org/ns/activitystreams#subject
}

type Create

type Create struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Create"`

	CoreEntity
	CoreObject
	CoreActivity
}

Create represents an ActivityPub / ActivityStream Activity type "Create".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create

Create is similar to AnyObject except its `Type` field is hard-coded to "Create".

func (Create) ProtoActivity

func (receiver Create) ProtoActivity() AnyActivity

func (Create) ProtoEntity

func (receiver Create) ProtoEntity() AnyEntity

func (Create) ProtoNode

func (receiver Create) ProtoNode() AnyNode

func (Create) ProtoObject

func (receiver Create) ProtoObject() AnyObject
func (Create) ProtoObjectOrProtoLink()

type Delete

type Delete struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Delete"`

	CoreEntity
	CoreObject
	CoreActivity
}

Delete represents an ActivityPub / ActivityStream Activity type "Delete".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete

Delete is similar to AnyObject except its `Type` field is hard-coded to "Delete".

func (Delete) ProtoActivity

func (receiver Delete) ProtoActivity() AnyActivity

func (Delete) ProtoEntity

func (receiver Delete) ProtoEntity() AnyEntity

func (Delete) ProtoNode

func (receiver Delete) ProtoNode() AnyNode

func (Delete) ProtoObject

func (receiver Delete) ProtoObject() AnyObject
func (Delete) ProtoObjectOrProtoLink()

type Dislike

type Dislike struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Dislike"`

	CoreEntity
	CoreObject
	CoreActivity
}

Dislike represents an ActivityPub / ActivityStream Activity type "Dislike".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike

Dislike is similar to AnyObject except its `Type` field is hard-coded to "Dislike".

func (Dislike) ProtoActivity

func (receiver Dislike) ProtoActivity() AnyActivity

func (Dislike) ProtoEntity

func (receiver Dislike) ProtoEntity() AnyEntity

func (Dislike) ProtoNode

func (receiver Dislike) ProtoNode() AnyNode

func (Dislike) ProtoObject

func (receiver Dislike) ProtoObject() AnyObject
func (Dislike) ProtoObjectOrProtoLink()

type Document

type Document struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Document"`

	CoreEntity
	CoreObject
}

Document represents an ActivityPub / ActivityStream Object type "Document".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-document

func (Document) ProtoEntity

func (receiver Document) ProtoEntity() AnyEntity

func (Document) ProtoNode

func (receiver Document) ProtoNode() AnyNode

func (Document) ProtoObject

func (receiver Document) ProtoObject() AnyObject
func (Document) ProtoObjectOrProtoLink()

type EndPoints

type EndPoints struct {
	OAuthAuthorizationEndPoint opt.Optional[string] `json:"oauthAuthorizationEndpoint,omitempty"`
	OAuthTokenEndPoint         opt.Optional[string] `json:"oauthTokenEndpoint,omitempty"`
	ProvideClientKey           opt.Optional[string] `json:"provideClientKey,omitempty"`
	ProxyURL                   opt.Optional[string] `json:"proxyUrl,omitempty"`
	SharedInBox                opt.Optional[string] `json:"sharedInbox,omitempty"`
	SignClientKey              opt.Optional[string] `json:"signClientKey,omitempty"`
	UploadMedia                opt.Optional[string] `json:"uploadMedia,omitempty"`
}

type Event

type Event struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Event"`

	CoreEntity
	CoreObject
}

Event represents an ActivityPub / ActivityStream Object type "Event".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event

func (Event) ProtoEntity

func (receiver Event) ProtoEntity() AnyEntity

func (Event) ProtoNode

func (receiver Event) ProtoNode() AnyNode

func (Event) ProtoObject

func (receiver Event) ProtoObject() AnyObject
func (Event) ProtoObjectOrProtoLink()

type Flag

type Flag struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Flag"`

	CoreEntity
	CoreObject
	CoreActivity
}

Flag represents an ActivityPub / ActivityStream Activity type "Flag".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-flag

Flag is similar to AnyObject except its `Type` field is hard-coded to "Flag".

func (Flag) ProtoActivity

func (receiver Flag) ProtoActivity() AnyActivity

func (Flag) ProtoEntity

func (receiver Flag) ProtoEntity() AnyEntity

func (Flag) ProtoNode

func (receiver Flag) ProtoNode() AnyNode

func (Flag) ProtoObject

func (receiver Flag) ProtoObject() AnyObject
func (Flag) ProtoObjectOrProtoLink()

type Follow

type Follow struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Follow"`

	CoreEntity
	CoreObject
	CoreActivity
}

Follow represents an ActivityPub / ActivityStream Activity type "Follow".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow

Follow is similar to AnyObject except its `Type` field is hard-coded to "Follow".

func (Follow) ProtoActivity

func (receiver Follow) ProtoActivity() AnyActivity

func (Follow) ProtoEntity

func (receiver Follow) ProtoEntity() AnyEntity

func (Follow) ProtoNode

func (receiver Follow) ProtoNode() AnyNode

func (Follow) ProtoObject

func (receiver Follow) ProtoObject() AnyObject
func (Follow) ProtoObjectOrProtoLink()

type Group

type Group struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Group"`

	CoreEntity
	CoreObject
	CoreActor
}

Group represents an ActivityPub / ActivityStream Object type "Group".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group

func (Group) ProtoActor

func (receiver Group) ProtoActor() AnyActor

func (Group) ProtoEntity

func (receiver Group) ProtoEntity() AnyEntity

func (Group) ProtoNode

func (receiver Group) ProtoNode() AnyNode

func (Group) ProtoObject

func (receiver Group) ProtoObject() AnyObject
func (Group) ProtoObjectOrProtoLink()

type HRef

type HRef string

LinkHRef represents the a collapsed form of an ActivityPub / ActivityStream "Link" type. For example:

"https://example.com/apple/banana/cherry"

Could be a collapsed form for:

{
	"type": "Link",
	"href": "https://example.com/apple/banana/cherry"
}

For documentation on the ActivityPub / ActivityStream Object "Link" type, see: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link

See also: Link.

func (HRef) MarshalText

func (receiver HRef) MarshalText() (text []byte, err error)

MarshalText makes HRef fit the encoding.TextMarshaler interface.

func (HRef) ProtoCollectionOrProtoLink()
func (HRef) ProtoCollectionPageOrProtoLink()

func (HRef) ProtoEntity

func (receiver HRef) ProtoEntity() AnyEntity
func (receiver HRef) ProtoLink() AnyLink

func (HRef) ProtoNode

func (receiver HRef) ProtoNode() AnyNode
func (HRef) ProtoObjectOrProtoLink()

func (HRef) String

func (receiver HRef) String() string

String makes HRef fit the fmt.Stringer interface.

func (*HRef) UnmarshalText

func (receiver *HRef) UnmarshalText(text []byte) error

UnmarshalText makes HRef fit the encoding.TextUnmarshaler interface.

type HashTag

type HashTag struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Hashtag"`

	CoreEntity
	CoreLink
}
func (HashTag) ProtoCollectionOrProtoLink()

Links

func (HashTag) ProtoCollectionPageOrProtoLink()

func (HashTag) ProtoEntity

func (receiver HashTag) ProtoEntity() AnyEntity
func (receiver HashTag) ProtoLink() AnyLink

func (HashTag) ProtoNode

func (receiver HashTag) ProtoNode() AnyNode
func (HashTag) ProtoObjectOrProtoLink()

Links

type Ignore

type Ignore struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Ignore"`

	CoreEntity
	CoreObject
	CoreActivity
}

Ignore represents an ActivityPub / ActivityStream Activity type "Ignore".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore

Ignore is similar to AnyObject except its `Type` field is hard-coded to "Ignore".

func (Ignore) ProtoActivity

func (receiver Ignore) ProtoActivity() AnyActivity

func (Ignore) ProtoEntity

func (receiver Ignore) ProtoEntity() AnyEntity

func (Ignore) ProtoNode

func (receiver Ignore) ProtoNode() AnyNode

func (Ignore) ProtoObject

func (receiver Ignore) ProtoObject() AnyObject
func (Ignore) ProtoObjectOrProtoLink()

type Image

type Image struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Image"`

	CoreEntity
	CoreObject
	CoreImage
}

func (Image) IsEmpty

func (receiver Image) IsEmpty() bool

func (Image) ProtoEntity

func (receiver Image) ProtoEntity() AnyEntity

func (Image) ProtoImage

func (receiver Image) ProtoImage() AnyImage

func (Image) ProtoNode

func (receiver Image) ProtoNode() AnyNode

func (Image) ProtoObject

func (receiver Image) ProtoObject() AnyObject
func (Image) ProtoObjectOrProtoLink()

type Invite

type Invite struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Invite"`

	CoreEntity
	CoreObject
	CoreActivity
}

Invite represents an ActivityPub / ActivityStream Activity type "Invite".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite

Invite is similar to AnyObject except its `Type` field is hard-coded to "Invite".

func (Invite) ProtoActivity

func (receiver Invite) ProtoActivity() AnyActivity

func (Invite) ProtoEntity

func (receiver Invite) ProtoEntity() AnyEntity

func (Invite) ProtoNode

func (receiver Invite) ProtoNode() AnyNode

func (Invite) ProtoObject

func (receiver Invite) ProtoObject() AnyObject
func (Invite) ProtoObjectOrProtoLink()

type Join

type Join struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Join"`

	CoreEntity
	CoreObject
	CoreActivity
}

Join represents an ActivityPub / ActivityStream Activity type "Join".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join

Join is similar to AnyObject except its `Type` field is hard-coded to "Join".

func (Join) ProtoActivity

func (receiver Join) ProtoActivity() AnyActivity

func (Join) ProtoEntity

func (receiver Join) ProtoEntity() AnyEntity

func (Join) ProtoNode

func (receiver Join) ProtoNode() AnyNode

func (Join) ProtoObject

func (receiver Join) ProtoObject() AnyObject
func (Join) ProtoObjectOrProtoLink()

type Leave

type Leave struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Leave"`

	CoreEntity
	CoreObject
	CoreActivity
}

Leave represents an ActivityPub / ActivityStream Activity type "Leave".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-leave

Leave is similar to AnyObject except its `Type` field is hard-coded to "Leave".

func (Leave) ProtoActivity

func (receiver Leave) ProtoActivity() AnyActivity

func (Leave) ProtoEntity

func (receiver Leave) ProtoEntity() AnyEntity

func (Leave) ProtoNode

func (receiver Leave) ProtoNode() AnyNode

func (Leave) ProtoObject

func (receiver Leave) ProtoObject() AnyObject
func (Leave) ProtoObjectOrProtoLink()

type Like

type Like struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Like"`

	CoreEntity
	CoreObject
	CoreActivity
}

Like represents an ActivityPub / ActivityStream Activity type "Like".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like

Like is similar to AnyObject except its `Type` field is hard-coded to "Like".

func (Like) ProtoActivity

func (receiver Like) ProtoActivity() AnyActivity

func (Like) ProtoEntity

func (receiver Like) ProtoEntity() AnyEntity

func (Like) ProtoNode

func (receiver Like) ProtoNode() AnyNode

func (Like) ProtoObject

func (receiver Like) ProtoObject() AnyObject
func (Like) ProtoObjectOrProtoLink()
type Link struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Link"`

	CoreEntity
	CoreLink
}

Link represents an ActivityPub / ActivityStream Link type "Link".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link

func (Link) ProtoCollectionOrProtoLink()
func (Link) ProtoCollectionPageOrProtoLink()

func (Link) ProtoEntity

func (receiver Link) ProtoEntity() AnyEntity
func (receiver Link) ProtoLink() AnyLink

func (Link) ProtoNode

func (receiver Link) ProtoNode() AnyNode
func (Link) ProtoObjectOrProtoLink()

type Listen

type Listen struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Listen"`

	CoreEntity
	CoreObject
	CoreActivity
}

Listen represents an ActivityPub / ActivityStream Activity type "Listen".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen

Listen is similar to AnyObject except its `Type` field is hard-coded to "Listen".

func (Listen) ProtoActivity

func (receiver Listen) ProtoActivity() AnyActivity

func (Listen) ProtoEntity

func (receiver Listen) ProtoEntity() AnyEntity

func (Listen) ProtoNode

func (receiver Listen) ProtoNode() AnyNode

func (Listen) ProtoObject

func (receiver Listen) ProtoObject() AnyObject
func (Listen) ProtoObjectOrProtoLink()

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map represents an ActivityStreams language-map field (such as "nameMap", "summaryMap", "contentMap") that is zero or more key-value pairs where both the key and value are strings.

The keys are BCP 47 language tags and the values are the corresponding text.

If its value is NoMap then its JSON / JSON-LD representation is the JSON / JSON-LD: null.

Otherwise its JSON / JSON-LD representation is a JSON object with string keys and string values.

Entries are stored sorted by key so that two Map values with the same entries are equal via ==.

Here is a JSON-LD example of what this Map type would be used:

"contentMap": {
	"cr": "<p>Tansi kahkiyaw! Niwîcihtân nêhiyawêwin êkwa decentralized web protocols.</p>",
	"en": "<p>Hello everyone! I love decentralized web protocols.</p>",
	"fa": "<p>سلام به همگی! من عاشق پروتکل‌های وب غیرمتمرکز هستم.</p>",
	"fr": "<p>Bonjour à tous ! J'adore les protocoles web décentralisés.</p>",
	"ja": "<p>皆さん、こんにちは!私は分散型ウェブプロトコルが大好きです。</p>",
	"ko": "<p>안녕하세요 여러분! 저는 분산형 웹 프로토콜을 좋아합니다.</p>",
	"pl": "<p>Cześć wszystkim! Uwielbiam zdecentralizowane protokoły internetowe.</p>"
},

Locally, this would be:

activitypub.SomeMaps(
	field.String("cr", "<p>Tansi kahkiyaw! Niwîcihtân nêhiyawêwin êkwa decentralized web protocols.</p>"),
	field.String("en", "<p>Hello everyone! I love decentralized web protocols.</p>"),
	field.String("fa", "<p>سلام به همگی! من عاشق پروتکل‌های وب غیرمتمرکز هستم.</p>"),
	field.String("fr", "<p>Bonjour à tous ! J'adore les protocoles web décentralisés.</p>"),
	field.String("ja", "<p>皆さん、こんにちは!私は分散型ウェブプロトコルが大好きです。</p>"),
	field.String("ko", "<p>안녕하세요 여러분! 저는 분산형 웹 프로토콜을 좋아합니다.</p>"),
	field.String("pl", "<p>Cześć wszystkim! Uwielbiam zdecentralizowane protokoły internetowe.</p>"),
)

func NoMap

func NoMap() Map

NoMap returns a Map with no entries in it.

func SomeMap

func SomeMap(entry field.StringlyField) Map

SomeMap returns a Map with one entry in it.

func SomeMaps

func SomeMaps(entries ...field.StringlyField) Map

SomeMaps returns a Map with many entries in it.

Entries are sorted by key. If duplicate keys are provided, the last value wins.

func (Map) Get

func (receiver Map) Get(key string) (string, bool)

Get returns the value for the given key and whether it was found.

func (Map) Map

func (receiver Map) Map() map[string]string

Map returns the entries as a map[string]string.

func (Map) MarshalJSON

func (receiver Map) MarshalJSON() ([]byte, error)

MarshalJSON makes Map fit the [json.Marshaler] interface.

func (*Map) UnmarshalJSON

func (receiver *Map) UnmarshalJSON(bytes []byte) error

UnmarshalJSON makes Map fit the [json.Unmarshaler] interface.

type Mention

type Mention struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Mention"`

	CoreEntity
	CoreLink
}

Mention represents an ActivityPub / ActivityStream Link type "Mention".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-mention

func (Mention) ProtoCollectionOrProtoLink()
func (Mention) ProtoCollectionPageOrProtoLink()

func (Mention) ProtoEntity

func (receiver Mention) ProtoEntity() AnyEntity
func (receiver Mention) ProtoLink() AnyLink

func (Mention) ProtoNode

func (receiver Mention) ProtoNode() AnyNode
func (Mention) ProtoObjectOrProtoLink()

type Move

type Move struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Move"`

	CoreEntity
	CoreObject
	CoreActivity
}

Move represents an ActivityPub / ActivityStream Activity type "Move".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-move

Move is similar to AnyObject except its `Type` field is hard-coded to "Move".

func (Move) ProtoActivity

func (receiver Move) ProtoActivity() AnyActivity

func (Move) ProtoEntity

func (receiver Move) ProtoEntity() AnyEntity

func (Move) ProtoNode

func (receiver Move) ProtoNode() AnyNode

func (Move) ProtoObject

func (receiver Move) ProtoObject() AnyObject
func (Move) ProtoObjectOrProtoLink()

type Note

type Note struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Note"`

	CoreEntity
	CoreObject
}

Note represents an ActivityPub / ActivityStream Object type "Note".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note

Note is similar to Object and AnyObject except its `Type` field is hard-coded to "Note".

func (Note) ProtoEntity

func (receiver Note) ProtoEntity() AnyEntity

func (Note) ProtoNode

func (receiver Note) ProtoNode() AnyNode

func (Note) ProtoObject

func (receiver Note) ProtoObject() AnyObject
func (Note) ProtoObjectOrProtoLink()

type Object

type Object struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Object"`

	CoreEntity
	CoreObject
}

Object represents the ActivityStreams object name-space used in a JSON-LD document.

Reference:

Example usage:

import (
	"codeberg.org/reiver/go-activitypub"
	"github.com/reiver/go-jsonld"
)

// ...

var object activitypub.Object

// ...

bytes, err := jsonld.Marshal(object)

More likely you would mix this with other JSON-LD name-spaces, with code similar to the following:

import (
	"codeberg.org/reiver/go-activitypub"
	"github.com/reiver/go-tootns"
	"github.com/reiver/go-jsonld"
)

// ...

var actor activitypub.Actor
var object activitypub.Object
var toot tootns.Toot

// ...

bytes, err := jsonld.Marshal(actor, object, toot)

See also:

func (Object) ProtoEntity

func (receiver Object) ProtoEntity() AnyEntity

func (Object) ProtoNode

func (receiver Object) ProtoNode() AnyNode

func (Object) ProtoObject

func (receiver Object) ProtoObject() AnyObject
func (Object) ProtoObjectOrProtoLink()

type ObjectID

type ObjectID string

ObjectID represents the collapsed form of an ActivityPub / ActivityStream Object, including its sub-types.

For example:

{
	"actor": "https://example.com/123"
}

Could be a collapsed form for:

{
	"actor": {
		"id": "https://example.com/123"
	}
}

func (ObjectID) MarshalText

func (receiver ObjectID) MarshalText() (text []byte, err error)

MarshalText makes ObjectID fit the encoding.TextMarshaler interface.

func (ObjectID) ProtoEntity

func (receiver ObjectID) ProtoEntity() AnyEntity

func (ObjectID) ProtoNode

func (receiver ObjectID) ProtoNode() AnyNode

func (ObjectID) ProtoObject

func (receiver ObjectID) ProtoObject() AnyObject
func (ObjectID) ProtoObjectOrProtoLink()

func (ObjectID) String

func (receiver ObjectID) String() string

String makes ObjectID fit the fmt.Stringer interface.

func (*ObjectID) UnmarshalText

func (receiver *ObjectID) UnmarshalText(text []byte) error

UnmarshalText makes ObjectID fit the encoding.TextUnmarshaler interface.

type ObjectURL

type ObjectURL struct {
	// contains filtered or unexported fields
}

ObjectURL is an alternative to AnyObject that just cares about the URL(s).

It also deals with the difference between an ActivityPub object's "url" being of type xsd:anyURI versus ActvityPub Link.

Call ObjectURL.URLs to get the object URL(s).

func (ObjectURL) URLs

func (receiver ObjectURL) URLs() []string

func (*ObjectURL) UnmarshalJSON

func (receiver *ObjectURL) UnmarshalJSON(bytes []byte) error

type Offer

type Offer struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Offer"`

	CoreEntity
	CoreObject
	CoreActivity
}

Offer represents an ActivityPub / ActivityStream Activity type "Offer".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-offer

Offer is similar to AnyObject except its `Type` field is hard-coded to "Offer".

func (Offer) ProtoActivity

func (receiver Offer) ProtoActivity() AnyActivity

func (Offer) ProtoEntity

func (receiver Offer) ProtoEntity() AnyEntity

func (Offer) ProtoNode

func (receiver Offer) ProtoNode() AnyNode

func (Offer) ProtoObject

func (receiver Offer) ProtoObject() AnyObject
func (Offer) ProtoObjectOrProtoLink()

type OrderedCollection

type OrderedCollection struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`                        // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-id
	Type json.Const[string] `json:"type" json.value:"OrderedCollection"` // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type

	CoreEntity
	CoreObject
	CoreCollection
	CoreOrderedCollection
}

OrderedCollection represents an ActivityPub / ActivityStream Collection type "OrderedCollection".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection

func (OrderedCollection) ProtoCollection

func (receiver OrderedCollection) ProtoCollection() AnyCollection
func (OrderedCollection) ProtoCollectionOrProtoLink()

func (OrderedCollection) ProtoEntity

func (receiver OrderedCollection) ProtoEntity() AnyEntity

func (OrderedCollection) ProtoNode

func (receiver OrderedCollection) ProtoNode() AnyNode

func (OrderedCollection) ProtoObject

func (receiver OrderedCollection) ProtoObject() AnyObject
func (OrderedCollection) ProtoObjectOrProtoLink()

func (OrderedCollection) ProtoOrderedCollection

func (receiver OrderedCollection) ProtoOrderedCollection() AnyOrderedCollection

type OrderedCollectionPage

type OrderedCollectionPage struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`                            // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-id
	Type json.Const[string] `json:"type" json.value:"OrderedCollectionPage"` // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type

	CoreEntity
	CoreObject
	CoreCollection
	CoreCollectionPage
	CoreOrderedCollection
	CoreOrderedCollectionPage
}

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollectionpage

func (OrderedCollectionPage) ProtoCollection

func (receiver OrderedCollectionPage) ProtoCollection() AnyCollection
func (OrderedCollectionPage) ProtoCollectionOrProtoLink()

func (OrderedCollectionPage) ProtoCollectionPage

func (receiver OrderedCollectionPage) ProtoCollectionPage() AnyCollectionPage
func (OrderedCollectionPage) ProtoCollectionPageOrProtoLink()

func (OrderedCollectionPage) ProtoEntity

func (receiver OrderedCollectionPage) ProtoEntity() AnyEntity

func (OrderedCollectionPage) ProtoNode

func (receiver OrderedCollectionPage) ProtoNode() AnyNode

func (OrderedCollectionPage) ProtoObject

func (receiver OrderedCollectionPage) ProtoObject() AnyObject
func (OrderedCollectionPage) ProtoObjectOrProtoLink()

func (OrderedCollectionPage) ProtoOrderedCollection

func (receiver OrderedCollectionPage) ProtoOrderedCollection() AnyOrderedCollection

func (OrderedCollectionPage) ProtoOrderedCollectionPage

func (receiver OrderedCollectionPage) ProtoOrderedCollectionPage() AnyOrderedCollectionPage

type Organization

type Organization struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Organization"`

	CoreEntity
	CoreObject
	CoreActor
}

Organization represents an ActivityPub / ActivityStream Object type "Organization".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-organization

func (Organization) ProtoActor

func (receiver Organization) ProtoActor() AnyActor

func (Organization) ProtoEntity

func (receiver Organization) ProtoEntity() AnyEntity

func (Organization) ProtoNode

func (receiver Organization) ProtoNode() AnyNode

func (Organization) ProtoObject

func (receiver Organization) ProtoObject() AnyObject
func (Organization) ProtoObjectOrProtoLink()

type Page

type Page struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Page"`

	CoreEntity
	CoreObject
}

Page represents an ActivityPub / ActivityStream Object type "Page".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-page

Page is similar to Object except its `Type` field is hard-coded to "Page".

func (Page) ProtoEntity

func (receiver Page) ProtoEntity() AnyEntity

func (Page) ProtoNode

func (receiver Page) ProtoNode() AnyNode

func (Page) ProtoObject

func (receiver Page) ProtoObject() AnyObject
func (Page) ProtoObjectOrProtoLink()

type Person

type Person struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Person"`

	CoreEntity
	CoreObject
	CoreActor
}

Person represents an ActivityPub / ActivityStream Object type "Person".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-Person

func (Person) ProtoActor

func (receiver Person) ProtoActor() AnyActor

func (Person) ProtoEntity

func (receiver Person) ProtoEntity() AnyEntity

func (Person) ProtoNode

func (receiver Person) ProtoNode() AnyNode

func (Person) ProtoObject

func (receiver Person) ProtoObject() AnyObject
func (Person) ProtoObjectOrProtoLink()

type Place

type Place struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Place"`

	CoreEntity
	CoreObject
}

Place represents an ActivityPub / ActivityStream Object type "Place".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-place

func (Place) ProtoEntity

func (receiver Place) ProtoEntity() AnyEntity

func (Place) ProtoNode

func (receiver Place) ProtoNode() AnyNode

func (Place) ProtoObject

func (receiver Place) ProtoObject() AnyObject
func (Place) ProtoObjectOrProtoLink()

type Profile

type Profile struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Profile"`

	CoreEntity
	CoreObject
}

Profile represents an ActivityPub / ActivityStream Object type "Profile".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-profile

func (Profile) ProtoEntity

func (receiver Profile) ProtoEntity() AnyEntity

func (Profile) ProtoNode

func (receiver Profile) ProtoNode() AnyNode

func (Profile) ProtoObject

func (receiver Profile) ProtoObject() AnyObject
func (Profile) ProtoObjectOrProtoLink()

type ProtoActivity

type ProtoActivity interface {
	ProtoObject
	ProtoActivity() AnyActivity
	IsPublic() bool
}

ProtoActivity represents something that is any type 'Activity', including sub-types.

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity

See also: AnyActivity.

func ProtoActivityUnmarshalJSON

func ProtoActivityUnmarshalJSON(data []byte) (ProtoActivity, error)

ProtoActivityUnmarshalJSON unmarshals raw JSON into a ProtoActivity.

A JSON string is unmarshaled as an AnyActivity with just an ID set (collapsed form). A JSON object is unmarshaled as an AnyActivity.

type ProtoActor

type ProtoActor interface {
	ProtoObject
	ProtoActor() AnyActor
}

ProtoActor represents something that is any type 'Actor', including sub-types.

See also: AnyActor.

func ProtoActorUnmarshalJSON

func ProtoActorUnmarshalJSON(data []byte) (ProtoActor, error)

ProtoActorUnmarshalJSON unmarshals raw JSON into a ProtoActor.

A JSON string is unmarshaled as an AnyActor with just an ID set (collapsed form). A JSON object is unmarshaled as an AnyActor.

type ProtoCollection

type ProtoCollection interface {
	ProtoObject
	ProtoCollection() AnyCollection
}

ProtoCollection represents something that is any type Collection, including sub-types.

See also: AnyCollection.

func ProtoCollectionUnmarshalJSON

func ProtoCollectionUnmarshalJSON(data []byte) (ProtoCollection, error)

ProtoCollectionUnmarshalJSON unmarshals raw JSON into a ProtoCollection.

A JSON string is unmarshaled as an AnyCollection with just an ID set (collapsed form). A JSON object is unmarshaled as an AnyCollection. A JSON array is skipped (returns nil) since an array of items is not itself a collection.

type ProtoCollectionOrProtoLink interface {
	ProtoCollectionOrProtoLink()
}

func ProtoCollectionOrProtoLinkUnmarshalJSON

func ProtoCollectionOrProtoLinkUnmarshalJSON(data []byte) (ProtoCollectionOrProtoLink, error)

ProtoCollectionOrProtoLinkUnmarshalJSON unmarshals raw JSON into a ProtoCollectionOrProtoLink.

A JSON string is unmarshaled as an HRef (collapsed form of a link). A JSON object with a Link-like type is unmarshaled as an AnyLink. A JSON object with a CollectionPage-like type is unmarshaled as an AnyCollectionPage. A JSON object otherwise is unmarshaled as an AnyCollection.

type ProtoCollectionPage

type ProtoCollectionPage interface {
	ProtoCollection
	ProtoCollectionPage() AnyCollectionPage
}

ProtoCollectionPage represents something that is any type CollectionPage, including sub-types.

See also: AnyCollectionPage.

func ProtoCollectionPageUnmarshalJSON

func ProtoCollectionPageUnmarshalJSON(data []byte) (ProtoCollectionPage, error)

ProtoCollectionPageUnmarshalJSON unmarshals raw JSON into a ProtoCollectionPage.

A JSON string is unmarshaled as an AnyCollectionPage with just an ID set (collapsed form). A JSON object is unmarshaled as an AnyCollectionPage.

type ProtoCollectionPageOrProtoLink interface {
	ProtoCollectionPageOrProtoLink()
}

func ProtoCollectionPageOrProtoLinkUnmarshalJSON

func ProtoCollectionPageOrProtoLinkUnmarshalJSON(data []byte) (ProtoCollectionPageOrProtoLink, error)

ProtoCollectionPageOrProtoLinkUnmarshalJSON unmarshals raw JSON into a ProtoCollectionPageOrProtoLink.

A JSON string is unmarshaled as an HRef (collapsed form of a link). A JSON object with a Link-like type is unmarshaled as an AnyLink. A JSON object otherwise is unmarshaled as an AnyCollectionPage.

type ProtoEntity

type ProtoEntity interface {
	ProtoNode
	ProtoEntity() AnyEntity
}

ProtoEntity represents something that is either a 'Object' or an 'Link', including sub-types for both.

ActivityPub / ActivityStreams doesn't actually have a single thing that represents this, but — one can note that if there 'Object' and 'Link' share 3 fields: "id", "type", "preview". Which are the fields that AnyEntity have.

See also: AnyEntity.

func ProtoEntityUnmarshalJSON

func ProtoEntityUnmarshalJSON(data []byte) (ProtoEntity, error)

ProtoEntityUnmarshalJSON unmarshals raw JSON into a ProtoEntity.

A JSON string is unmarshaled as an ObjectID (collapsed form of an object). A JSON object is unmarshaled as an AnyLink if its "type" field is a known Link type ("Link", "Mention", "Hashtag"), otherwise as an AnyObject.

type ProtoImage

type ProtoImage interface {
	ProtoObject
	ProtoImage() AnyImage
}

ProtoImage represents something that is any type 'Image', including sub-types.

See also: AnyImage.

func ProtoImageUnmarshalJSON

func ProtoImageUnmarshalJSON(data []byte) (ProtoImage, error)

ProtoImageUnmarshalJSON unmarshals raw JSON into a ProtoImage.

A JSON string is unmarshaled as an ObjectID (which does not satisfy ProtoImage, so this returns an error). A JSON object is unmarshaled as an AnyImage.

type ProtoIntransitiveActivity

type ProtoIntransitiveActivity interface {
	ProtoActivity
	ProtoIntransitiveActivity() AnyIntransitiveActivity
}

ProtoIntransitiveActivity represents something that is any type 'IntransitiveActivity', including sub-types.

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity

See also: AnyIntransitiveActivity.

type ProtoLink interface {
	ProtoEntity
	ProtoLink() AnyLink
}

func ProtoLinkUnmarshalJSON

func ProtoLinkUnmarshalJSON(data []byte) (ProtoLink, error)

ProtoLinkUnmarshalJSON unmarshals raw JSON into a ProtoLink.

A JSON string is unmarshaled as an HRef (collapsed form of a link). A JSON object is unmarshaled as an AnyLink.

type ProtoNode

type ProtoNode interface {
	ProtoNode() AnyNode
}

ProtoNode is used to represent the "Range" = "Object | Link" found in ActivityPub / ActivityStreams: https://www.w3.org/TR/activitystreams-vocabulary/

func ProtoNodeUnmarshalJSON

func ProtoNodeUnmarshalJSON(data []byte) (ProtoNode, error)

ProtoNodeUnmarshalJSON unmarshals raw JSON into a ProtoNode.

A JSON string is unmarshaled as an ObjectID (collapsed form of an object). A JSON object is unmarshaled as an AnyLink if its "type" field is a known Link type ("Link", "Mention", "Hashtag"), otherwise as an AnyObject.

func ProtoNodeUnmarshalJSONs

func ProtoNodeUnmarshalJSONs(data []byte) ([]ProtoNode, error)

ProtoNodeUnmarshalJSONs unmarshals raw JSON into a slice of ProtoNode.

A JSON array is expected, where each element follows the same rules as ProtoNodeUnmarshalJSON.

type ProtoObject

type ProtoObject interface {
	ProtoEntity
	ProtoObject() AnyObject
}

ProtoObject represents something that is any type 'Object', including sub-types.

See also: AnyObject.

func ProtoObjectUnmarshalJSON

func ProtoObjectUnmarshalJSON(data []byte) (ProtoObject, error)

ProtoObjectUnmarshalJSON unmarshals raw JSON into a ProtoObject.

A JSON string is unmarshaled as an ObjectID (collapsed form of an object). A JSON object is unmarshaled as an AnyObject.

type ProtoObjectOrProtoLink interface {
	ProtoObjectOrProtoLink()
}

func ProtoObjectOrProtoLinkUnmarshalJSON

func ProtoObjectOrProtoLinkUnmarshalJSON(data []byte) (ProtoObjectOrProtoLink, error)

func ProtoObjectOrProtoLinkUnmarshalJSONs

func ProtoObjectOrProtoLinkUnmarshalJSONs(data []byte) ([]ProtoObjectOrProtoLink, error)

ProtoObjectOrProtoLinkUnmarshalJSON unmarshals raw JSON into a ProtoObjectOrProtoLink.

A JSON string is unmarshaled as an ObjectID (collapsed form of an object). A JSON object with a Link-like type is unmarshaled as an AnyLink. A JSON object otherwise is unmarshaled as an AnyObject. ProtoObjectOrProtoLinkUnmarshalJSONs unmarshals raw JSON into a slice of ProtoObjectOrProtoLink.

A JSON array is expected, where each element follows the same rules as ProtoObjectOrProtoLinkUnmarshalJSON.

type ProtoOrderedCollection

type ProtoOrderedCollection interface {
	ProtoCollection
	ProtoOrderedCollection() AnyOrderedCollection
}

ProtoOrderedCollection represents something that is any type OrderedCollection, including sub-types.

See also: AnyOrderedCollection.

type ProtoQuestion

type ProtoQuestion interface {
	ProtoIntransitiveActivity
	ProtoQuestion() AnyQuestion
}

type ProtoRelationship

type ProtoRelationship interface {
	ProtoObject
	ProtoRelationship() AnyRelationship
}

ProtoObject represents something that is any type 'Object', including sub-types.

See also: AnyObject.

func ProtoRelationshipUnmarshalJSON

func ProtoRelationshipUnmarshalJSON(data []byte) (ProtoRelationship, error)

ProtoRelationshipUnmarshalJSON unmarshals raw JSON into a ProtoRelationship.

A JSON string is unmarshaled as an AnyRelationship with just an ID set (collapsed form). A JSON object is unmarshaled as an AnyRelationship.

type Question

type Question struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Question"`

	CoreEntity
	CoreObject
	CoreActivity
	CoreQuestion
}

Question represents an ActivityPub / ActivityStream Activity type "Question".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-question

Question is similar to AnyObject except its `Type` field is hard-coded to "Question".

func (Question) ProtoActivity

func (receiver Question) ProtoActivity() AnyActivity

func (Question) ProtoEntity

func (receiver Question) ProtoEntity() AnyEntity

func (Question) ProtoIntransitiveActivity

func (receiver Question) ProtoIntransitiveActivity() AnyIntransitiveActivity

func (Question) ProtoNode

func (receiver Question) ProtoNode() AnyNode

func (Question) ProtoObject

func (receiver Question) ProtoObject() AnyObject
func (Question) ProtoObjectOrProtoLink()

func (Question) ProtoQuestion

func (receiver Question) ProtoQuestion() AnyQuestion

type RawActivity

type RawActivity struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`

	Actor      *gojson.RawMessage `json:"actor,omitempty"`
	Instrument *gojson.RawMessage `json:"instrument,omitempty"`
	Object     *gojson.RawMessage `json:"object,omitempty"`
	Origin     *gojson.RawMessage `json:"origin,omitempty"`
	Result     *gojson.RawMessage `json:"result,omitempty"`
	Target     *gojson.RawMessage `json:"target,omitempty"`
}

RawActivity is used by AnyActivity.UnmarshalJSON to decode Activity JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity) are kept as raw JSON so they can be decoded in a second pass.

type RawActor

type RawActor struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`

	EndPoints         EndPoints            `json:"endpoints,omitempty"`
	Followers         opt.Optional[string] `json:"followers,omitempty"`
	Following         opt.Optional[string] `json:"following,omitempty"`
	InBox             opt.Optional[string] `json:"inbox,omitempty"`
	Liked             opt.Optional[string] `json:"liked,omitempty"`
	OutBox            opt.Optional[string] `json:"outbox,omitempty"`
	PreferredUserName Strings              `json:"preferredUsername,omitempty"`
}

RawActor is used by AnyActor.UnmarshalJSON to decode Actor JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity) are kept as raw JSON so they can be decoded in a second pass.

type RawCollection

type RawCollection struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`

	Current    *gojson.RawMessage        `json:"current,omitempty"`
	First      *gojson.RawMessage        `json:"first,omitempty"`
	Items      *gojson.RawMessage        `json:"items,omitempty"`
	Last       *gojson.RawMessage        `json:"last,omitempty"`
	TotalItems nul.Nullable[WholeNumber] `json:"totalItems,omitempty"`
}

RawCollection is used by AnyCollection.UnmarshalJSON to decode Collection JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity, ProtoCollection, ProtoCollectionOrProtoLink) are kept as raw JSON so they can be decoded in a second pass.

type RawCollectionPage

type RawCollectionPage struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`

	Current    *gojson.RawMessage        `json:"current,omitempty"`
	First      *gojson.RawMessage        `json:"first,omitempty"`
	Items      *gojson.RawMessage        `json:"items,omitempty"`
	Last       *gojson.RawMessage        `json:"last,omitempty"`
	TotalItems nul.Nullable[WholeNumber] `json:"totalItems,omitempty"`

	PartOf *gojson.RawMessage `json:"partOf,omitempty"`
	Next   *gojson.RawMessage `json:"next,omitempty"`
	Prev   *gojson.RawMessage `json:"prev,omitempty"`
}

RawCollectionPage is used by AnyCollectionPage.UnmarshalJSON to decode CollectionPage JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity, ProtoCollection, ProtoCollectionOrProtoLink, ProtoCollectionPageOrProtoLink) are kept as raw JSON so they can be decoded in a second pass.

type RawImage

type RawImage struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`
}

RawImage is used by AnyImage.UnmarshalJSON to decode Image JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity) are kept as raw JSON so they can be decoded in a second pass.

type RawLink struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	Height    WholeNumber          `json:"height,omitempty"`
	HRef      opt.Optional[string] `json:"href,omitempty"`
	HRefLang  opt.Optional[string] `json:"hreflang,omitempty"`
	MediaType opt.Optional[string] `json:"mediaType,omitempty"`
	Rel       Strings              `json:"rel,omitempty"`
	Width     WholeNumber          `json:"width,omitempty"`
}

RawLink is used by AnyLink.UnmarshalJSON to decode Link JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoEntity) are kept as raw JSON so they can be decoded in a second pass.

type RawObject

type RawObject struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`
}

RawObject is used by AnyObject.UnmarshalJSON to decode Object JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity) are kept as raw JSON so they can be decoded in a second pass.

type RawRelationship

type RawRelationship struct {
	ID   jsonld.ID    `json:"id,omitempty"`
	Type jsonld.Types `json:"type,omitempty"`

	Name    opt.Optional[string] `json:"name,omitempty"`
	NameMap Map                  `json:"nameMap,omitempty"`
	Preview *gojson.RawMessage   `json:"preview,omitempty"`

	AlsoKnownAs  Strings              `json:"alsoKnownAs,omitempty"`
	Attachments  *gojson.RawMessage   `json:"attachment,omitempty"`
	AttributedTo *gojson.RawMessage   `json:"attributedTo,omitempty"`
	Audiences    *gojson.RawMessage   `json:"audience,omitempty"`
	CC           Strings              `json:"cc,omitempty"`
	Content      opt.Optional[string] `json:"content,omitempty"`
	ContentMap   Map                  `json:"contentMap,omitempty"`
	Duration     opt.Optional[string] `json:"duration,omitempty"`
	EndTime      opt.Optional[string] `json:"endTime,omitempty"`
	Generator    *gojson.RawMessage   `json:"generator,omitempty"`
	Icon         *gojson.RawMessage   `json:"icon,omitempty"`
	Image        *gojson.RawMessage   `json:"image,omitempty"`
	InReplyTo    Strings              `json:"inReplyTo,omitempty"`
	Location     *gojson.RawMessage   `json:"location,omitempty"`
	MediaType    opt.Optional[string] `json:"mediaType,omitempty"`
	MovedTo      opt.Optional[string] `json:"movedTo,omitempty"`
	Published    opt.Optional[string] `json:"published,omitempty"`
	StartTime    opt.Optional[string] `json:"startTime,omitempty"`
	Summary      nul.Nullable[string] `json:"summary,omitempty"`
	SummaryMap   Map                  `json:"summaryMap,omitempty"`
	Tags         *gojson.RawMessage   `json:"tag,omitempty"`
	To           Strings              `json:"to,omitempty"`
	Updated      opt.Optional[string] `json:"updated,omitempty"`
	URL          *gojson.RawMessage   `json:"url,omitempty"`

	Likes   *gojson.RawMessage `json:"likes,omitempty"`
	Shares  *gojson.RawMessage `json:"shares,omitempty"`
	Replies *gojson.RawMessage `json:"replies,omitempty"`

	Object       *gojson.RawMessage `json:"object,omitempty"`       // https://www.w3.org/ns/activitystreams#object
	Relationship *gojson.RawMessage `json:"relationship,omitempty"` // https://www.w3.org/ns/activitystreams#relationship
	Subject      *gojson.RawMessage `json:"subject,omitempty"`      // https://www.w3.org/ns/activitystreams#subject
}

RawRelationship is used by AnyRelationship.UnmarshalJSON to decode Relationship JSON in two passes.

Fields with concrete types are decoded directly by the first pass. Fields with interface types (ProtoNode, ProtoImage, ProtoEntity, ProtoObject, ProtoObjectOrProtoLink) are kept as raw JSON so they can be decoded in a second pass.

type Read

type Read struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Read"`

	CoreEntity
	CoreObject
	CoreActivity
}

Read represents an ActivityPub / ActivityStream Activity type "Read".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read

Read is similar to AnyObject except its `Type` field is hard-coded to "Read".

func (Read) ProtoActivity

func (receiver Read) ProtoActivity() AnyActivity

func (Read) ProtoEntity

func (receiver Read) ProtoEntity() AnyEntity

func (Read) ProtoNode

func (receiver Read) ProtoNode() AnyNode

func (Read) ProtoObject

func (receiver Read) ProtoObject() AnyObject
func (Read) ProtoObjectOrProtoLink()

type Reject

type Reject struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Reject"`

	CoreEntity
	CoreObject
	CoreActivity
}

Reject represents an ActivityPub / ActivityStream Activity type "Reject".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject

Reject is similar to AnyObject except its `Type` field is hard-coded to "Reject".

func (Reject) ProtoActivity

func (receiver Reject) ProtoActivity() AnyActivity

func (Reject) ProtoEntity

func (receiver Reject) ProtoEntity() AnyEntity

func (Reject) ProtoNode

func (receiver Reject) ProtoNode() AnyNode

func (Reject) ProtoObject

func (receiver Reject) ProtoObject() AnyObject
func (Reject) ProtoObjectOrProtoLink()

type Relationship

type Relationship struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Relationship"`

	CoreEntity
	CoreObject
	CoreRelationship
}

Relationship represents an ActivityPub / ActivityStream Object type "Relationship".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-relationship

func (Relationship) ProtoEntity

func (receiver Relationship) ProtoEntity() AnyEntity

func (Relationship) ProtoNode

func (receiver Relationship) ProtoNode() AnyNode

func (Relationship) ProtoObject

func (receiver Relationship) ProtoObject() AnyObject
func (Relationship) ProtoObjectOrProtoLink()

func (Relationship) ProtoRelationship

func (receiver Relationship) ProtoRelationship() AnyRelationship

type Remove

type Remove struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Remove"`

	CoreEntity
	CoreObject
	CoreActivity
}

Remove represents an ActivityPub / ActivityStream Activity type "Remove".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove

Remove is similar to AnyObject except its `Type` field is hard-coded to "Remove".

func (Remove) ProtoActivity

func (receiver Remove) ProtoActivity() AnyActivity

func (Remove) ProtoEntity

func (receiver Remove) ProtoEntity() AnyEntity

func (Remove) ProtoNode

func (receiver Remove) ProtoNode() AnyNode

func (Remove) ProtoObject

func (receiver Remove) ProtoObject() AnyObject
func (Remove) ProtoObjectOrProtoLink()

type Service

type Service struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Service"`

	CoreEntity
	CoreObject
	CoreActor
}

Service represents an ActivityPub / ActivityStream Object type "Service".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-service

func (Service) ProtoActor

func (receiver Service) ProtoActor() AnyActor

func (Service) ProtoEntity

func (receiver Service) ProtoEntity() AnyEntity

func (Service) ProtoNode

func (receiver Service) ProtoNode() AnyNode

func (Service) ProtoObject

func (receiver Service) ProtoObject() AnyObject
func (Service) ProtoObjectOrProtoLink()

type Strings

type Strings struct {
	// contains filtered or unexported fields
}

Strings represents an ActivityStreams "type" field that is zero, one, or many strings.

And, the way it marshals to JSON / JSON-LD is different depending on whether it is zero, one, or many strings.

If its value is NoStrings then its JSON / JSON-LD representation is the JSON / JSON-LD: null.

If its value is SomeString then its JSON / JSON-LD representation is the JSON / JSON-LD: string.

If its value is SomeStrings then its JSON / JSON-LD representation is the JSON / JSON-LD: array (of string).

func NoStrings

func NoStrings() Strings

NoStrings returns a Strings with no strings in it.

This is more-or-less similar to the concept of "none" and "nothing" with optional-types. Note that "optional-types" are also known as 'option-types' and 'maybe-types'.

func SomeString

func SomeString(value string) Strings

SomeString returns a Strings with one string in it.

This is more-or-less similar to the concept of "some" and "something" with optional-types. Note that "optional-types" are also known as 'option-types' and 'maybe-types'.

func SomeStrings

func SomeStrings(values ...string) Strings

SomeStrings returns a Strings with many strings in it.

func (Strings) MarshalJSON

func (receiver Strings) MarshalJSON() ([]byte, error)

MarshalJSON makes Strings fit the [json.Marshaler] interface.

func (Strings) Strings

func (receiver Strings) Strings() []string

Strings returns the strings within a Strings.

func (*Strings) UnmarshalJSON

func (receiver *Strings) UnmarshalJSON(bytes []byte) error

UnmarshalJSON makes Strings fit the [json.Unmarshaler] interface.

type TentativeAccept

type TentativeAccept struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"TentativeAccept"`

	CoreEntity
	CoreObject
	CoreActivity
}

TentativeAccept represents an ActivityPub / ActivityStream Activity type "TentativeAccept".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativeaccept

TentativeAccept is similar to AnyObject except its `Type` field is hard-coded to "TentativeAccept".

func (TentativeAccept) ProtoActivity

func (receiver TentativeAccept) ProtoActivity() AnyActivity

func (TentativeAccept) ProtoEntity

func (receiver TentativeAccept) ProtoEntity() AnyEntity

func (TentativeAccept) ProtoNode

func (receiver TentativeAccept) ProtoNode() AnyNode

func (TentativeAccept) ProtoObject

func (receiver TentativeAccept) ProtoObject() AnyObject
func (TentativeAccept) ProtoObjectOrProtoLink()

type TentativeReject

type TentativeReject struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"TentativeReject"`

	CoreEntity
	CoreObject
	CoreActivity
}

TentativeReject represents an ActivityPub / ActivityStream Activity type "TentativeReject".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativereject

TentativeReject is similar to AnyObject except its `Type` field is hard-coded to "TentativeReject".

func (TentativeReject) ProtoActivity

func (receiver TentativeReject) ProtoActivity() AnyActivity

func (TentativeReject) ProtoEntity

func (receiver TentativeReject) ProtoEntity() AnyEntity

func (TentativeReject) ProtoNode

func (receiver TentativeReject) ProtoNode() AnyNode

func (TentativeReject) ProtoObject

func (receiver TentativeReject) ProtoObject() AnyObject
func (TentativeReject) ProtoObjectOrProtoLink()

type Tombstone

type Tombstone struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Tombstone"`

	CoreEntity
	CoreObject
}

Tombstone represents an ActivityPub / ActivityStream Object type "Tombstone".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone

func (Tombstone) ProtoEntity

func (receiver Tombstone) ProtoEntity() AnyEntity

func (Tombstone) ProtoNode

func (receiver Tombstone) ProtoNode() AnyNode

func (Tombstone) ProtoObject

func (receiver Tombstone) ProtoObject() AnyObject
func (Tombstone) ProtoObjectOrProtoLink()

type Undo

type Undo struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Undo"`

	CoreEntity
	CoreObject
	CoreActivity
}

Undo represents an ActivityPub / ActivityStream Activity type "Undo".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo

Undo is similar to AnyObject except its `Type` field is hard-coded to "Undo".

func (Undo) ProtoActivity

func (receiver Undo) ProtoActivity() AnyActivity

func (Undo) ProtoEntity

func (receiver Undo) ProtoEntity() AnyEntity

func (Undo) ProtoNode

func (receiver Undo) ProtoNode() AnyNode

func (Undo) ProtoObject

func (receiver Undo) ProtoObject() AnyObject
func (Undo) ProtoObjectOrProtoLink()

func (Travel) ProtoObjectOrProtoLink() {}

type UnsafeObject

type UnsafeObject struct {
	// contains filtered or unexported fields
}

func UnsafeObjectWrap

func UnsafeObjectWrap(bytes []byte) UnsafeObject

func (UnsafeObject) MarshalJSON

func (receiver UnsafeObject) MarshalJSON() ([]byte, error)

func (UnsafeObject) ProtoEntity

func (receiver UnsafeObject) ProtoEntity() AnyEntity

func (UnsafeObject) ProtoNode

func (receiver UnsafeObject) ProtoNode() AnyNode

func (UnsafeObject) ProtoObject

func (receiver UnsafeObject) ProtoObject() AnyObject
func (receiver UnsafeObject) ProtoObjectOrProtoLink()

type Update

type Update struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Update"`

	CoreEntity
	CoreObject
	CoreActivity
}

Update represents an ActivityPub / ActivityStream Activity type "Update".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update

Update is similar to AnyObject except its `Type` field is hard-coded to "Update".

func (Update) ProtoActivity

func (receiver Update) ProtoActivity() AnyActivity

func (Update) ProtoEntity

func (receiver Update) ProtoEntity() AnyEntity

func (Update) ProtoNode

func (receiver Update) ProtoNode() AnyNode

func (Update) ProtoObject

func (receiver Update) ProtoObject() AnyObject
func (Update) ProtoObjectOrProtoLink()

type Video

type Video struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"Video"`

	CoreEntity
	CoreObject
}

Video represents an ActivityPub / ActivityStream Object type "Video".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video

func (Video) ProtoEntity

func (receiver Video) ProtoEntity() AnyEntity

func (Video) ProtoNode

func (receiver Video) ProtoNode() AnyNode

func (Video) ProtoObject

func (receiver Video) ProtoObject() AnyObject
func (Video) ProtoObjectOrProtoLink()

type View

type View struct {
	NameSpace jsonld.NameSpace `jsonld:"https://www.w3.org/ns/activitystreams"`
	Prefix    jsonld.Prefix    `jsonld:"as"`

	ID   jsonld.ID          `json:"id,omitempty"`
	Type json.Const[string] `json:"type" json.value:"View"`

	CoreEntity
	CoreObject
	CoreActivity
}

View represents an ActivityPub / ActivityStream Activity type "View".

https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view

View is similar to AnyObject except its `Type` field is hard-coded to "View".

func (View) ProtoActivity

func (receiver View) ProtoActivity() AnyActivity

func (View) ProtoEntity

func (receiver View) ProtoEntity() AnyEntity

func (View) ProtoNode

func (receiver View) ProtoNode() AnyNode

func (View) ProtoObject

func (receiver View) ProtoObject() AnyObject
func (View) ProtoObjectOrProtoLink()

type WholeNumber

type WholeNumber uint64

WholeNumber represents a non-negative integer.

func (WholeNumber) MarshalJSON

func (receiver WholeNumber) MarshalJSON() ([]byte, error)

MarshalJSON makes WholeNumber fit the [json.Marshaler] interface.

func (*WholeNumber) UnmarshalJSON

func (receiver *WholeNumber) UnmarshalJSON(data []byte) error

MarshalJSON makes WholeNumber fit the [json.Unmarshaler] interface.

Source Files

Directories

Path Synopsis
ns

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL