activitypub

package module
v0.0.0-...-81405e1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 19 Imported by: 0

README

Activity Pub for Go

MIT Licensed Build Status Test Coverage Go Report Card

Basic package for using ActivityPub API in Go.

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

Usage

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

Note about generics

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

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

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

Documentation

Index

Constants

View Source
const (
	// ActivityBaseURI the URI for the ActivityStreams namespace
	ActivityBaseURI = IRI("https://www.w3.org/ns/activitystreams")
	// SecurityContextURI the URI for the security namespace (for an Actor's PublicKey)
	SecurityContextURI = IRI("https://w3id.org/security/v1")
	// PublicNS is the reference to the Public entity in the ActivityStreams namespace
	PublicNS = ActivityBaseURI + "#Public"
)
View Source
const (
	// EmptyIRI represents a zero length IRI
	EmptyIRI IRI = ""
	// NilIRI represents by convention an IRI which is nil
	// Its use is mostly to check if a property of an ActivityPub Item is nil
	NilIRI IRI = "-"

	// EmptyID represents a zero length ID
	EmptyID = EmptyIRI
	// NilID represents by convention an ID which is nil, see details of NilIRI
	NilID = NilIRI
)
View Source
const (
	Unknown   = CollectionPath("")
	Outbox    = CollectionPath("outbox")
	Inbox     = CollectionPath("inbox")
	Shares    = CollectionPath("shares")
	Replies   = CollectionPath("replies") // activitystreams
	Following = CollectionPath("following")
	Followers = CollectionPath("followers")
	Liked     = CollectionPath("liked")
	Likes     = CollectionPath("likes")
)

Variables

ActorTypes represent the valid Actor types.

View Source
var CollectionManagementActivityTypes = ActivityVocabularyTypes{
	AddType,
	MoveType,
	RemoveType,
}

CollectionManagementActivityTypes use case primarily deals with activities involving the management of content within collections.

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

Examples of collections include things like folders, albums, friend lists, etc. This includes, for instance, activities such as "Sally added a file to Folder A", "John moved the file from Folder A to Folder B", etc.

View Source
var ContentExperienceActivityTypes = ActivityVocabularyTypes{
	ListenType,
	ReadType,
	ViewType,
}

ContentExperienceActivityTypes use case primarily deals with describing activities involving listening to, reading, or viewing content.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-experience

For instance, "Sally read the article", "Joe listened to the song".

View Source
var ContentManagementActivityTypes = ActivityVocabularyTypes{
	CreateType,
	DeleteType,
	UpdateType,
}

ContentManagementActivityTypes use case primarily deals with activities that involve the creation, modification or deletion of content.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-crud

This includes, for instance, activities such as "John created a new note", "Sally updated an article", and "Joe deleted the photo".

View Source
var DefaultLang = NilLangRef

DefaultLang represents the default language reference used when using the convenience content generation.

EventRSVPActivityTypes use case primarily deals with invitations to events and RSVP type responses.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-rsvp

View Source
var GeoSocialEventsActivityTypes = ActivityVocabularyTypes{
	ArriveType,
	LeaveType,
	TravelType,
}

GeoSocialEventsActivityTypes use case primarily deals with activities involving geo-tagging type activities.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-geo

For instance, it can include activities such as "Joe arrived at work", "Sally left work", and "John is travel from home to work".

View Source
var GroupManagementActivityTypes = ActivityVocabularyTypes{
	AddType,
	JoinType,
	LeaveType,
	RemoveType,
}

GroupManagementActivityTypes use case primarily deals with management of groups.

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

It can include, for instance, activities such as "John added Sally to Group A", "Sally joined Group A", "Joe left Group A", etc.

View Source
var IntransitiveActivityTypes = ActivityVocabularyTypes{
	ArriveType,
	TravelType,
	QuestionType,
}
View Source
var JsonLDContext = []IRI{
	ActivityBaseURI,
	SecurityContextURI,
}

JsonLDContext is a slice of IRIs that form the default context for the objects in the GoActivitypub vocabulary. It does not represent just the default ActivityStreams public namespace, but it also has the W3 Permanent Identifier Community Group's Security namespace, which appears in the Actor type objects, which contain public key related data.

LinkTypes represent the valid values for a Link object

View Source
var NegatingActivityTypes = ActivityVocabularyTypes{
	UndoType,
}

NegatingActivityTypes use case primarily deals with the ability to redact previously completed activities.

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

See 5.5 Inverse Activities and "Undo" for more information. https://www.w3.org/TR/activitystreams-vocabulary/#inverse

View Source
var NotificationActivityTypes = ActivityVocabularyTypes{
	AnnounceType,
}

NotificationActivityTypes use case primarily deals with calling attention to particular objects or notifications.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-notification

View Source
var OffersActivityTypes = ActivityVocabularyTypes{
	OfferType,
}

OffersActivityTypes use case deals with activities involving offering one object to another.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-offers

It can include, for instance, activities such as "Company A is offering a discount on purchase of Product Z to Sally", "Sally is offering to add a File to Folder A", etc.

View Source
var QuestionActivityTypes = ActivityVocabularyTypes{
	QuestionType,
}

QuestionActivityTypes use case primarily deals with representing inquiries of any type.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-questions

See 5.4 Representing Questions for more information. https://www.w3.org/TR/activitystreams-vocabulary/#questions

ReactionsActivityTypes use case primarily deals with reactions to content.

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-reactions

This can include activities such as liking or disliking content, ignoring updates, flagging content as being inappropriate, accepting or rejecting objects, etc.

RelationshipManagementActivityTypes use case primarily deals with representing activities involving the management of interpersonal and social relationships

https://www.w3.org/TR/activitystreams-vocabulary/#motivations-relationships

(e.g. friend requests, management of social network, etc). See 5.2 Representing Relationships Between Entities for more information. https://www.w3.org/TR/activitystreams-vocabulary/#connections

Types contains all valid types in the ActivityPub vocabulary

Functions

func ErrorInvalidType

func ErrorInvalidType[T Objects | Links](received Item) error

func GobEncode

func GobEncode(it Item) ([]byte, error)

func IsIRI

func IsIRI(it Item) bool

IsIRI returns if the current Item interface holds an IRI

func IsItemCollection

func IsItemCollection(it Item) bool

IsItemCollection returns if the current Item interface holds a Collection

func IsLink(it Item) bool

IsLink returns if the current Item interface holds a Link

func IsNil

func IsNil(it Item) bool

IsNil checks if the object matching an ObjectOrLink interface is nil

func IsObject

func IsObject(it Item) bool

IsObject returns if the current Item interface holds an Object

func ItemOrderTimestamp

func ItemOrderTimestamp(i1, i2 Item) bool

ItemOrderTimestamp is used for ordering a ItemCollection slice using the slice.Sort function It orders i1 and i2 based on their Published and Updated timestamps.

func ItemsEqual

func ItemsEqual(it, with Item) bool

ItemsEqual checks if it and with Items are equal

func JSONGetBoolean

func JSONGetBoolean(val *fastjson.Value, prop string) bool

func JSONGetBytes

func JSONGetBytes(val *fastjson.Value, prop string) []byte

func JSONGetDuration

func JSONGetDuration(val *fastjson.Value, prop string) time.Duration

func JSONGetFloat

func JSONGetFloat(val *fastjson.Value, prop string) float64

func JSONGetInt

func JSONGetInt(val *fastjson.Value, prop string) int64

func JSONGetString

func JSONGetString(val *fastjson.Value, prop string) string

func JSONGetTime

func JSONGetTime(val *fastjson.Value, prop string) time.Time

func JSONLoadActivity

func JSONLoadActivity(val *fastjson.Value, a *Activity) error

func JSONLoadActor

func JSONLoadActor(val *fastjson.Value, a *Actor) error

func JSONLoadCollection

func JSONLoadCollection(val *fastjson.Value, c *Collection) error

func JSONLoadCollectionPage

func JSONLoadCollectionPage(val *fastjson.Value, c *CollectionPage) error

func JSONLoadIntransitiveActivity

func JSONLoadIntransitiveActivity(val *fastjson.Value, i *IntransitiveActivity) error
func JSONLoadLink(val *fastjson.Value, l *Link) error

func JSONLoadObject

func JSONLoadObject(val *fastjson.Value, o *Object) error

func JSONLoadOrderedCollection

func JSONLoadOrderedCollection(val *fastjson.Value, c *OrderedCollection) error

func JSONLoadOrderedCollectionPage

func JSONLoadOrderedCollectionPage(val *fastjson.Value, c *OrderedCollectionPage) error

func JSONLoadPlace

func JSONLoadPlace(val *fastjson.Value, p *Place) error

func JSONLoadProfile

func JSONLoadProfile(val *fastjson.Value, p *Profile) error

func JSONLoadPublicKey

func JSONLoadPublicKey(val *fastjson.Value, p *PublicKey) error

func JSONLoadQuestion

func JSONLoadQuestion(val *fastjson.Value, q *Question) error

func JSONLoadRelationship

func JSONLoadRelationship(val *fastjson.Value, r *Relationship) error

func JSONLoadTombstone

func JSONLoadTombstone(val *fastjson.Value, t *Tombstone) error

func JSONWrite

func JSONWrite(b *[]byte, c ...byte)

func JSONWriteActivityJSONValue

func JSONWriteActivityJSONValue(b *[]byte, a Activity) (notEmpty bool)

func JSONWriteBoolJSONProp

func JSONWriteBoolJSONProp(b *[]byte, n string, t bool) (notEmpty bool)

func JSONWriteComma

func JSONWriteComma(b *[]byte)

func JSONWriteDurationJSONProp

func JSONWriteDurationJSONProp(b *[]byte, n string, d time.Duration) (notEmpty bool)

func JSONWriteFloatJSONProp

func JSONWriteFloatJSONProp(b *[]byte, n string, f float64) (notEmpty bool)

func JSONWriteIRIJSONProp

func JSONWriteIRIJSONProp(b *[]byte, n string, i LinkOrIRI) (notEmpty bool)

func JSONWriteIntJSONProp

func JSONWriteIntJSONProp(b *[]byte, n string, d int64) (notEmpty bool)

func JSONWriteIntransitiveActivityJSONValue

func JSONWriteIntransitiveActivityJSONValue(b *[]byte, i IntransitiveActivity) (notEmpty bool)

func JSONWriteItemCollectionJSONProp

func JSONWriteItemCollectionJSONProp(b *[]byte, n string, col ItemCollection) (notEmpty bool)

func JSONWriteItemCollectionJSONValue

func JSONWriteItemCollectionJSONValue(b *[]byte, col ItemCollection) (notEmpty bool)

func JSONWriteItemJSONProp

func JSONWriteItemJSONProp(b *[]byte, n string, i Item) (notEmpty bool)

func JSONWriteJSONProp

func JSONWriteJSONProp(b *[]byte, name string, val []byte) (notEmpty bool)

func JSONWriteJSONValue

func JSONWriteJSONValue(b *[]byte, s []byte) (notEmpty bool)

func JSONWriteLinkJSONValue

func JSONWriteLinkJSONValue(b *[]byte, l Link) (notEmpty bool)

func JSONWriteNaturalLanguageJSONProp

func JSONWriteNaturalLanguageJSONProp(b *[]byte, n string, nl NaturalLanguageValues) (notEmpty bool)

func JSONWriteObjectJSONValue

func JSONWriteObjectJSONValue(b *[]byte, o Object) (notEmpty bool)

func JSONWritePropJSONName

func JSONWritePropJSONName(b *[]byte, s string) (notEmpty bool)

func JSONWriteQuestionJSONValue

func JSONWriteQuestionJSONValue(b *[]byte, q Question) (notEmpty bool)

func JSONWriteS

func JSONWriteS(b *[]byte, s string)

func JSONWriteStringJSONProp

func JSONWriteStringJSONProp(b *[]byte, n string, s string) (notEmpty bool)

func JSONWriteStringJSONValue

func JSONWriteStringJSONValue(b *[]byte, s string) (notEmpty bool)

func JSONWriteTimeJSONProp

func JSONWriteTimeJSONProp(b *[]byte, n string, t time.Time) (notEmpty bool)

func MarshalJSON

func MarshalJSON(it Item) ([]byte, error)

MarshalJSON represents just a wrapper for the jsonld.Marshal function

func NotEmpty

func NotEmpty(i Item) bool

NotEmpty tells us if a Item interface value has a non nil value for various types that implement

func On

func On[T Item](it Item, fn func(*T) error) error

On handles in a generic way the call to fn(*T) if the "it" Item can be asserted to one of the Objects type. It also covers the case where "it" is a collection of items that match the assertion.

func OnActivity

func OnActivity(it Item, fn WithActivityFn) error

OnActivity calls function fn on it Item if it can be asserted to type *Activity

This function should be called if trying to access the Activity specific properties like "object", for the other properties OnObject, or OnIntransitiveActivity should be used instead.

func OnActor

func OnActor(it Item, fn WithActorFn) error

OnActor calls function fn on it Item if it can be asserted to type *Actor

This function should be called if trying to access the Actor specific properties like "preferredName", "publicKey", etc. For the other properties OnObject should be used instead.

func OnCollection

func OnCollection(it Item, fn WithCollectionFn) error

OnCollection calls function fn on it Item if it can be asserted to type *Collection

This function should be called if trying to access the Collection specific properties like "totalItems", "items", etc. For the other properties OnObject should be used instead.

func OnCollectionIntf

func OnCollectionIntf(it Item, fn WithCollectionInterfaceFn) error

OnCollectionIntf calls function fn on it Item if it can be asserted to a type that implements the CollectionInterface

This function should be called if Item represents a collection of ActivityPub objects. It basically wraps functionality for the different collection types supported by the package.

func OnCollectionPage

func OnCollectionPage(it Item, fn WithCollectionPageFn) error

OnCollectionPage calls function fn on it Item if it can be asserted to type *CollectionPage

This function should be called if trying to access the CollectionPage specific properties like "partOf", "next", "perv". For the other properties OnObject or OnCollection should be used instead.

func OnIntransitiveActivity

func OnIntransitiveActivity(it Item, fn WithIntransitiveActivityFn) error

OnIntransitiveActivity calls function fn on it Item if it can be asserted to type *IntransitiveActivity

This function should be called if trying to access the IntransitiveActivity specific properties like "actor", for the other properties OnObject should be used instead.

func OnItemCollection

func OnItemCollection(it Item, fn WithItemCollectionFn) error

OnItemCollection calls function fn on it Item if it can be asserted to type ItemCollection

It should be used when Item represents an Item collection and it's usually used as a way to wrap functionality for other functions that will be called on each item in the collection.

func OnLink(it LinkOrIRI, fn WithLinkFn) error

OnLink calls function fn on it Item if it can be asserted to type *Link

This function should be safe to use for all types with a structure compatible with the Link type

func OnObject

func OnObject(it Item, fn WithObjectFn) error

OnObject calls function fn on it Item if it can be asserted to type *Object

This function should be safe to be called for all types with a structure compatible to the Object type.

func OnOrderedCollection

func OnOrderedCollection(it Item, fn WithOrderedCollectionFn) error

OnOrderedCollection calls function fn on it Item if it can be asserted to type *OrderedCollection

This function should be called if trying to access the Collection specific properties like "totalItems", "orderedItems", etc. For the other properties OnObject should be used instead.

func OnOrderedCollectionPage

func OnOrderedCollectionPage(it Item, fn WithOrderedCollectionPageFn) error

OnOrderedCollectionPage calls function fn on it Item if it can be asserted to type *OrderedCollectionPage

This function should be called if trying to access the OrderedCollectionPage specific properties like "partOf", "next", "perv". For the other properties OnObject or OnOrderedCollection should be used instead.

func OnPlace

func OnPlace(it Item, fn withPlaceFn) error

OnPlace calls function fn on it Item if it can be asserted to type *Place

This function should be called if trying to access the Place specific properties like "accuracy", "altitude", "latitude", "longitude", "radius", or "units". For the other properties OnObject should be used instead.

func OnProfile

func OnProfile(it Item, fn withProfileFn) error

OnProfile calls function fn on it Item if it can be asserted to type *Profile

This function should be called if trying to access the Profile specific properties like "describes". For the other properties OnObject should be used instead.

func OnQuestion

func OnQuestion(it Item, fn WithQuestionFn) error

OnQuestion calls function fn on it Item if it can be asserted to type Question

This function should be called if trying to access the Questions specific properties like "anyOf", "oneOf", "closed", etc. For the other properties OnObject or OnIntransitiveActivity should be used instead.

func OnRelationship

func OnRelationship(it Item, fn withRelationshipFn) error

OnRelationship calls function fn on it Item if it can be asserted to type *Relationship

This function should be called if trying to access the Relationship specific properties like "subject", "object", or "relationship". For the other properties OnObject should be used instead.

func OnTombstone

func OnTombstone(it Item, fn withTombstoneFn) error

OnTombstone calls function fn on it Item if it can be asserted to type *Tombstone

This function should be called if trying to access the Tombstone specific properties like "formerType" or "deleted". For the other properties OnObject should be used instead.

func Split

func Split(i IRI) (IRI, CollectionPath)

Split returns the base IRI of received i, if i represents an IRI matching CollectionPath type t

func To

func To[T Item](it Item) (*T, error)

func ValidActivityCollection

func ValidActivityCollection(typ CollectionPath) bool

ValidActivityCollection shows if the current ActivityPub end-point type is a valid one for handling Activities

func ValidCollection

func ValidCollection(typ CollectionPath) bool

func ValidCollectionIRI

func ValidCollectionIRI(i IRI) bool

func ValidObjectCollection

func ValidObjectCollection(typ CollectionPath) bool

ValidActivityCollection shows if the current ActivityPub end-point type is a valid one for handling Objects

Types

type Accept

type Accept = Activity

Accept indicates that the actor accepts the object. The target property can be used in certain circumstances to indicate the context into which the object has been accepted.

func AcceptNew

func AcceptNew(id ID, ob Item) *Accept

AcceptNew initializes an Accept activity

type Activities

type Activities interface {
	Activity
}

type Activity

type Activity struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// CanReceiveActivities describes one or more entities that either performed or are expected to perform the activity.
	// Any single activity can have multiple actors. The actor may be specified using an indirect Link.
	Actor Item `jsonld:"actor,omitempty"`
	// Target describes the indirect object, or target, of the activity.
	// The precise meaning of the target is largely dependent on the type of action being described
	// but will often be the object of the English preposition "to".
	// For instance, in the activity "John added a movie to his wishlist",
	// the target of the activity is John's wishlist. An activity can have more than one target.
	Target Item `jsonld:"target,omitempty"`
	// Result describes the result of the activity. For instance, if a particular action results in the creation
	// of a new resource, the result property can be used to describe that new resource.
	Result Item `jsonld:"result,omitempty"`
	// Origin describes an indirect object of the activity from which the activity is directed.
	// The precise meaning of the origin is the object of the English preposition "from".
	// For instance, in the activity "John moved an item to List B from List A", the origin of the activity is "List A".
	Origin Item `jsonld:"origin,omitempty"`
	// Instrument identifies one or more objects used (or to be used) in the completion of an Activity.
	Instrument Item `jsonld:"instrument,omitempty"`
	// Object When used within an Activity, describes the direct object of the activity.
	// For instance, in the activity "John added a movie to his wishlist",
	// the object of the activity is the movie added.
	// When used within a Relationship describes the entity to which the subject is related.
	Object Item `jsonld:"object,omitempty"`
}

Activity is a subtype of Object that describes some form of action that may happen, is currently happening, or has already happened. The Activity type itself serves as an abstract base type for all types of activities. It is important to note that the Activity type itself does not carry any specific semantics about the kind of action being taken.

func ActivityNew

func ActivityNew(id ID, typ ActivityVocabularyType, ob Item) *Activity

ActivityNew initializes a basic activity

func FlattenActivityProperties

func FlattenActivityProperties(act *Activity) *Activity

FlattenActivityProperties flattens the Activity's properties from Object type to IRI

func ToActivity

func ToActivity(it Item) (*Activity, error)

ToActivity

func (*Activity) Clean

func (a *Activity) Clean()

Clean removes Bto and BCC properties

func (Activity) Equals

func (a Activity) Equals(with Item) bool

Equals verifies if our receiver Object is equals with the "with" Object

func (Activity) Format

func (a Activity) Format(s fmt.State, verb rune)

func (Activity) GetID

func (a Activity) GetID() ID

GetID returns the ID corresponding to the Activity object

func (a Activity) GetLink() IRI

GetLink returns the IRI corresponding to the Activity object

func (Activity) GetType

func (a Activity) GetType() ActivityVocabularyType

GetType returns the ActivityVocabulary type of the current Activity

func (*Activity) GobDecode

func (a *Activity) GobDecode(data []byte) error

GobDecode

func (Activity) GobEncode

func (a Activity) GobEncode() ([]byte, error)

GobEncode

func (Activity) IsCollection

func (a Activity) IsCollection() bool

IsCollection returns false for Activity objects

func (a Activity) IsLink() bool

IsLink returns false for Activity objects

func (Activity) IsObject

func (a Activity) IsObject() bool

IsObject returns true for Activity objects

func (Activity) MarshalBinary

func (a Activity) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Activity) MarshalJSON

func (a Activity) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Activity) Recipients

func (a *Activity) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Activity's To, Bto, CC and BCC properties

func (*Activity) UnmarshalBinary

func (a *Activity) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Activity) UnmarshalJSON

func (a *Activity) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type ActivityObject

type ActivityObject interface {
	// GetID returns the dereferenceable ActivityStreams object id
	GetID() ID
	// GetType returns the ActivityStreams type
	GetType() ActivityVocabularyType
}

ActivityObject is a subtype of Object that describes some form of action that may happen, is currently happening, or has already happened

type ActivityVocabularyType

type ActivityVocabularyType string

ActivityVocabularyType is the data type for an Activity type object

const (
	AcceptType          ActivityVocabularyType = "Accept"
	AddType             ActivityVocabularyType = "Add"
	AnnounceType        ActivityVocabularyType = "Announce"
	ArriveType          ActivityVocabularyType = "Arrive"
	BlockType           ActivityVocabularyType = "Block"
	CreateType          ActivityVocabularyType = "Create"
	DeleteType          ActivityVocabularyType = "Delete"
	DislikeType         ActivityVocabularyType = "Dislike"
	FlagType            ActivityVocabularyType = "Flag"
	FollowType          ActivityVocabularyType = "Follow"
	IgnoreType          ActivityVocabularyType = "Ignore"
	InviteType          ActivityVocabularyType = "Invite"
	JoinType            ActivityVocabularyType = "Join"
	LeaveType           ActivityVocabularyType = "Leave"
	LikeType            ActivityVocabularyType = "Like"
	ListenType          ActivityVocabularyType = "Listen"
	MoveType            ActivityVocabularyType = "Move"
	OfferType           ActivityVocabularyType = "Offer"
	QuestionType        ActivityVocabularyType = "Question"
	RejectType          ActivityVocabularyType = "Reject"
	ReadType            ActivityVocabularyType = "Read"
	RemoveType          ActivityVocabularyType = "Remove"
	TentativeRejectType ActivityVocabularyType = "TentativeReject"
	TentativeAcceptType ActivityVocabularyType = "TentativeAccept"
	TravelType          ActivityVocabularyType = "Travel"
	UndoType            ActivityVocabularyType = "Undo"
	UpdateType          ActivityVocabularyType = "Update"
	ViewType            ActivityVocabularyType = "View"
)

Activity Types

const (
	ApplicationType  ActivityVocabularyType = "Application"
	GroupType        ActivityVocabularyType = "Group"
	OrganizationType ActivityVocabularyType = "Organization"
	PersonType       ActivityVocabularyType = "Person"
	ServiceType      ActivityVocabularyType = "Service"
)

CanReceiveActivities Types

const (
	IRIType                   ActivityVocabularyType = "IRI"
	ObjectType                ActivityVocabularyType = "Object"
	LinkType                  ActivityVocabularyType = "Link"
	ActivityType              ActivityVocabularyType = "Activity"
	IntransitiveActivityType  ActivityVocabularyType = "IntransitiveActivity"
	ActorType                 ActivityVocabularyType = "Actor"
	CollectionType            ActivityVocabularyType = "Collection"
	OrderedCollectionType     ActivityVocabularyType = "OrderedCollection"
	CollectionPageType        ActivityVocabularyType = "CollectionPage"
	OrderedCollectionPageType ActivityVocabularyType = "OrderedCollectionPage"

	// ActivityPub Object Types
	ArticleType      ActivityVocabularyType = "Article"
	AudioType        ActivityVocabularyType = "Audio"
	DocumentType     ActivityVocabularyType = "Document"
	EventType        ActivityVocabularyType = "Event"
	ImageType        ActivityVocabularyType = "Image"
	NoteType         ActivityVocabularyType = "Note"
	PageType         ActivityVocabularyType = "Page"
	PlaceType        ActivityVocabularyType = "Place"
	ProfileType      ActivityVocabularyType = "Profile"
	RelationshipType ActivityVocabularyType = "Relationship"
	TombstoneType    ActivityVocabularyType = "Tombstone"
	VideoType        ActivityVocabularyType = "Video"

	// MentionType is a link type for @mentions
	MentionType ActivityVocabularyType = "Mention"
)
const CollectionOfItems ActivityVocabularyType = "ItemCollection"

func JSONGetType

func JSONGetType(val *fastjson.Value) ActivityVocabularyType

func (*ActivityVocabularyType) GobDecode

func (a *ActivityVocabularyType) GobDecode(data []byte) error

GobDecode

func (ActivityVocabularyType) GobEncode

func (a ActivityVocabularyType) GobEncode() ([]byte, error)

GobEncode

func (ActivityVocabularyType) MarshalBinary

func (a ActivityVocabularyType) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (ActivityVocabularyType) MarshalJSON

func (a ActivityVocabularyType) MarshalJSON() ([]byte, error)

func (*ActivityVocabularyType) UnmarshalBinary

func (a *ActivityVocabularyType) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

type ActivityVocabularyTypes

type ActivityVocabularyTypes []ActivityVocabularyType

ActivityVocabularyTypes is a type alias for a slice of ActivityVocabularyType elements

func (ActivityVocabularyTypes) Contains

type Actor

type Actor struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor;
	// see 5.2 Inbox.
	Inbox Item `jsonld:"inbox,omitempty"`
	// An [ActivityStreams] OrderedCollection comprised of all the messages produced by the actor;
	// see 5.1 outbox.
	Outbox Item `jsonld:"outbox,omitempty"`
	// A link to an [ActivityStreams] collection of the actors that this actor is following;
	// see 5.4 Following Collection
	Following Item `jsonld:"following,omitempty"`
	// A link to an [ActivityStreams] collection of the actors that follow this actor;
	// see 5.3 Followers Collection.
	Followers Item `jsonld:"followers,omitempty"`
	// A link to an [ActivityStreams] collection of objects this actor has liked;
	// see 5.5 Liked Collection.
	Liked Item `jsonld:"liked,omitempty"`
	// A short username which may be used to refer to the actor, with no uniqueness guarantees.
	PreferredUsername NaturalLanguageValues `jsonld:"preferredUsername,omitempty,collapsible"`
	// A json object which maps additional (typically server/domain-wide) endpoints which may be useful either
	// for this actor or someone referencing this actor.
	// This mapping may be nested inside the actor document as the value or may be a link
	// to a JSON-LD document with these properties.
	Endpoints *Endpoints `jsonld:"endpoints,omitempty"`
	// A list of supplementary Collections which may be of interest.
	Streams   ItemCollection `jsonld:"streams,omitempty"`
	PublicKey PublicKey      `jsonld:"publicKey,omitempty"`
}

Actor is generally one of the ActivityStreams actor Types, but they don't have to be. For example, a Profile object might be used as an actor, or a type from an ActivityStreams extension. Actors are retrieved like any other Object in ActivityPub. Like other ActivityStreams objects, actors have an id, which is a URI.

func ActorNew

func ActorNew(id ID, typ ActivityVocabularyType) *Actor

ActorNew initializes an CanReceiveActivities type actor

func FlattenActorProperties

func FlattenActorProperties(a *Actor) *Actor

FlattenActorProperties flattens the Actor's properties from Object types to IRI

func ToActor

func ToActor(it Item) (*Actor, error)

ToActor

func UpdatePersonProperties

func UpdatePersonProperties(old, new *Actor) (*Actor, error)

UpdatePersonProperties

func (*Actor) Clean

func (a *Actor) Clean()

func (Actor) Equals

func (a Actor) Equals(with Item) bool

Equals verifies if our receiver Object is equals with the "with" Object

func (Actor) Format

func (a Actor) Format(s fmt.State, verb rune)

func (Actor) GetID

func (a Actor) GetID() ID

GetID returns the ID corresponding to the current Actor

func (a Actor) GetLink() IRI

GetLink returns the IRI corresponding to the current Actor

func (Actor) GetType

func (a Actor) GetType() ActivityVocabularyType

GetType returns the type of the current Actor

func (*Actor) GobDecode

func (a *Actor) GobDecode(data []byte) error

func (Actor) GobEncode

func (a Actor) GobEncode() ([]byte, error)

func (Actor) IsCollection

func (a Actor) IsCollection() bool

IsCollection returns false for Actor Objects

func (a Actor) IsLink() bool

IsLink validates if currentActivity Pub Actor is a Link

func (Actor) IsObject

func (a Actor) IsObject() bool

IsObject validates if currentActivity Pub Actor is an Object

func (Actor) MarshalBinary

func (a Actor) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Actor) MarshalJSON

func (a Actor) MarshalJSON() ([]byte, error)

func (*Actor) Recipients

func (a *Actor) Recipients() ItemCollection

func (*Actor) UnmarshalBinary

func (a *Actor) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Actor) UnmarshalJSON

func (a *Actor) UnmarshalJSON(data []byte) error

type Actors

type Actors interface {
	Actor
}

type Add

type Add = Activity

Add indicates that the actor has added the object to the target. If the target property is not explicitly specified, the target would need to be determined implicitly by context. The origin can be used to identify the context from which the object originated.

func AddNew

func AddNew(id ID, ob Item, trgt Item) *Add

AddNew initializes an Add activity

type Announce

type Announce = Activity

Announce indicates that the actor is calling the target's attention the object. The origin typically has no defined meaning.

func AnnounceNew

func AnnounceNew(id ID, ob Item) *Announce

AnnounceNew initializes an Announce activity

type Application

type Application = Actor

Application describes a software application.

func ApplicationNew

func ApplicationNew(id ID) *Application

ApplicationNew initializes an Application type actor

type Arrive

type Arrive = IntransitiveActivity

Arrive is an IntransitiveActivity that indicates that the actor has arrived at the location. The origin can be used to identify the context from which the actor originated. The target typically has no defined meaning.

func ArriveNew

func ArriveNew(id ID) *Arrive

ArriveNew initializes an Arrive activity

type Article

type Article = Object

Article represents any kind of multi-paragraph written work.

type Audio

type Audio = Document

Audio represents an audio document of any kind.

type Block

type Block = Ignore

Block indicates that the actor is blocking the object. Blocking is a stronger form of Ignore. The typical use is to support social systems that allow one user to block activities or content of other users. The target and origin typically have no defined meaning.

func BlockNew

func BlockNew(id ID, ob Item) *Block

BlockNew initializes a Block activity

type CanReceiveActivities

type CanReceiveActivities Item

CanReceiveActivities is generally one of the ActivityStreams Actor Types, but they don't have to be. For example, a Profile object might be used as an actor, or a type from an ActivityStreams extension. Actors are retrieved like any other Object in ActivityPub. Like other ActivityStreams objects, actors have an id, which is a URI.

type Collection

type Collection struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// In a paged Collection, indicates the page that contains the most recently updated member items.
	Current ObjectOrLink `jsonld:"current,omitempty"`
	// In a paged Collection, indicates the furthest preceding page of items in the collection.
	First ObjectOrLink `jsonld:"first,omitempty"`
	// In a paged Collection, indicates the furthest proceeding page of the collection.
	Last ObjectOrLink `jsonld:"last,omitempty"`
	// A non-negative integer specifying the total number of objects contained by the logical view of the collection.
	// This number might not reflect the actual number of items serialized within the Collection object instance.
	TotalItems uint `jsonld:"totalItems"`
	// Identifies the items contained in a collection. The items might be ordered or unordered.
	Items ItemCollection `jsonld:"items,omitempty"`
}

Collection is a subtype of Activity Pub Object that represents ordered or unordered sets of Activity Pub Object or Link instances.

func CollectionNew

func CollectionNew(id ID) *Collection

CollectionNew initializes a new Collection

func CopyCollectionProperties

func CopyCollectionProperties(old, new *Collection) (*Collection, error)

func FlattenCollection

func FlattenCollection(col *Collection) *Collection

FlattenCollection flattens a Collection's objects to their respective IRIs

func ToCollection

func ToCollection(it Item) (*Collection, error)

ToCollection

func (*Collection) Append

func (c *Collection) Append(ob Item) error

Append adds an element to a Collection

func (Collection) Collection

func (c Collection) Collection() ItemCollection

Collection returns the Collection's items

func (Collection) Contains

func (c Collection) Contains(r Item) bool

Contains verifies if Collection array contains the received one

func (*Collection) Count

func (c *Collection) Count() uint

Count returns the maximum between the length of Items in collection and its TotalItems property

func (Collection) Equals

func (c Collection) Equals(with Item) bool

Equals

func (Collection) Format

func (c Collection) Format(s fmt.State, verb rune)

func (Collection) GetID

func (c Collection) GetID() ID

GetID returns the ID corresponding to the Collection object

func (c Collection) GetLink() IRI

GetLink returns the IRI corresponding to the Collection object

func (Collection) GetType

func (c Collection) GetType() ActivityVocabularyType

GetType returns the Collection's type

func (*Collection) GobDecode

func (c *Collection) GobDecode(data []byte) error

func (Collection) GobEncode

func (c Collection) GobEncode() ([]byte, error)

func (Collection) IsCollection

func (c Collection) IsCollection() bool

IsCollection returns true for Collection objects

func (c Collection) IsLink() bool

IsLink returns false for a Collection object

func (Collection) IsObject

func (c Collection) IsObject() bool

IsObject returns true for a Collection object

func (Collection) ItemsMatch

func (c Collection) ItemsMatch(col ...Item) bool

ItemsMatch

func (Collection) MarshalBinary

func (c Collection) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Collection) MarshalJSON

func (c Collection) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Collection) UnmarshalBinary

func (c *Collection) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Collection) UnmarshalJSON

func (c *Collection) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type CollectionInterface

type CollectionInterface interface {
	ObjectOrLink
	Collection() ItemCollection
	Append(ob Item) error
	Count() uint
	Contains(Item) bool
}

type CollectionPage

type CollectionPage struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// In a paged Collection, indicates the page that contains the most recently updated member items.
	Current ObjectOrLink `jsonld:"current,omitempty"`
	// In a paged Collection, indicates the furthest preceding page of items in the collection.
	First ObjectOrLink `jsonld:"first,omitempty"`
	// In a paged Collection, indicates the furthest proceeding page of the collection.
	Last ObjectOrLink `jsonld:"last,omitempty"`
	// A non-negative integer specifying the total number of objects contained by the logical view of the collection.
	// This number might not reflect the actual number of items serialized within the Collection object instance.
	TotalItems uint `jsonld:"totalItems"`
	// Identifies the items contained in a collection. The items might be unordered.
	Items ItemCollection `jsonld:"items,omitempty"`
	// Identifies the Collection to which a CollectionPage objects items belong.
	PartOf Item `jsonld:"partOf,omitempty"`
	// In a paged Collection, indicates the next page of items.
	Next Item `jsonld:"next,omitempty"`
	// In a paged Collection, identifies the previous page of items.
	Prev Item `jsonld:"prev,omitempty"`
}

CollectionPage is a Collection that contains a large number of items and when it becomes impractical for an implementation to serialize every item contained by a Collection using the items property alone. In such cases, the items within a Collection can be divided into distinct subsets or "pages".

func CollectionPageNew

func CollectionPageNew(parent CollectionInterface) *CollectionPage

CollectionNew initializes a new CollectionPage

func CopyCollectionPageProperties

func CopyCollectionPageProperties(old, new *CollectionPage) (*CollectionPage, error)

func ToCollectionPage

func ToCollectionPage(it Item) (*CollectionPage, error)

ToCollectionPage

func (*CollectionPage) Append

func (c *CollectionPage) Append(ob Item) error

Append adds an element to a CollectionPage

func (CollectionPage) Collection

func (c CollectionPage) Collection() ItemCollection

Collection returns the ColleCollectionPagection items

func (CollectionPage) Contains

func (c CollectionPage) Contains(r Item) bool

Contains verifies if CollectionPage array contains the received one

func (*CollectionPage) Count

func (c *CollectionPage) Count() uint

Count returns the maximum between the length of Items in the collection page and its TotalItems property

func (CollectionPage) Equals

func (c CollectionPage) Equals(with Item) bool

Equals

func (CollectionPage) Format

func (c CollectionPage) Format(s fmt.State, verb rune)

func (CollectionPage) GetID

func (c CollectionPage) GetID() ID

GetID returns the ID corresponding to the CollectionPage object

func (c CollectionPage) GetLink() IRI

GetLink returns the IRI corresponding to the CollectionPage object

func (CollectionPage) GetType

GetType returns the CollectionPage's type

func (*CollectionPage) GobDecode

func (c *CollectionPage) GobDecode(data []byte) error

func (CollectionPage) GobEncode

func (c CollectionPage) GobEncode() ([]byte, error)

func (CollectionPage) IsCollection

func (c CollectionPage) IsCollection() bool

IsCollection returns true for CollectionPage objects

func (c CollectionPage) IsLink() bool

IsLink returns false for a CollectionPage object

func (CollectionPage) IsObject

func (c CollectionPage) IsObject() bool

IsObject returns true for a CollectionPage object

func (CollectionPage) ItemsMatch

func (c CollectionPage) ItemsMatch(col ...Item) bool

ItemsMatch

func (CollectionPage) MarshalBinary

func (c CollectionPage) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (CollectionPage) MarshalJSON

func (c CollectionPage) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*CollectionPage) UnmarshalBinary

func (c *CollectionPage) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*CollectionPage) UnmarshalJSON

func (c *CollectionPage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type CollectionPath

type CollectionPath string

CollectionPath

func (CollectionPath) AddTo

func (t CollectionPath) AddTo(i Item) (IRI, bool)

AddTo adds CollectionPath type IRI on the corresponding property of the i Item

func (CollectionPath) IRI

func (t CollectionPath) IRI(i Item) IRI

IRI gives us the IRI of the t CollectionPath type corresponding to the i Item, or generates a new one if not found.

func (CollectionPath) Of

func (t CollectionPath) Of(i Item) Item

Of gives us the property of the i Item that corresponds to the t CollectionPath type.

func (CollectionPath) OfActor

func (t CollectionPath) OfActor(i IRI) (IRI, error)

OfActor returns the base IRI of received i, if i represents an IRI matching CollectionPath type t

type CollectionPaths

type CollectionPaths []CollectionPath

CollectionPaths

func (CollectionPaths) Contains

func (t CollectionPaths) Contains(typ CollectionPath) bool

func (CollectionPaths) Split

func (t CollectionPaths) Split(i IRI) (IRI, CollectionPath)

Split splits the IRI in an actor IRI and its CollectionPath if the CollectionPath is found in the elements in the t CollectionPaths slice

type Content

type Content []byte

func (Content) Equals

func (c Content) Equals(other Content) bool

func (Content) Format

func (c Content) Format(s fmt.State, verb rune)

func (*Content) GobDecode

func (c *Content) GobDecode(data []byte) error

func (Content) GobEncode

func (c Content) GobEncode() ([]byte, error)

func (Content) String

func (c Content) String() string

func (*Content) UnmarshalJSON

func (c *Content) UnmarshalJSON(data []byte) error

func (*Content) UnmarshalText

func (c *Content) UnmarshalText(data []byte) error

type Create

type Create = Activity

Create indicates that the actor has created the object.

func CreateNew

func CreateNew(id ID, ob Item) *Create

CreateNew initializes a Create activity

type Delete

type Delete = Activity

Delete indicates that the actor has deleted the object. If specified, the origin indicates the context from which the object was deleted.

func DeleteNew

func DeleteNew(id ID, ob Item) *Delete

DeleteNew initializes a Delete activity

type Dislike

type Dislike = Activity

Dislike indicates that the actor dislikes the object.

func DislikeNew

func DislikeNew(id ID, ob Item) *Dislike

DislikeNew initializes a Dislike activity

type Document

type Document = Object

Document represents a document of any kind.

type Endpoints

type Endpoints struct {
	// UploadMedia Upload endpoint URI for this user for binary data.
	UploadMedia Item `jsonld:"uploadMedia,omitempty"`
	// OauthAuthorizationEndpoint Endpoint URI so this actor's clients may access remote ActivityStreams objects which require authentication
	// to access. To use this endpoint, the client posts an x-www-form-urlencoded id parameter with the value being
	// the id of the requested ActivityStreams object.
	OauthAuthorizationEndpoint Item `jsonld:"oauthAuthorizationEndpoint,omitempty"`
	// OauthTokenEndpoint If OAuth 2.0 bearer tokens [RFC6749] [RFC6750] are being used for authenticating client to server interactions,
	// this endpoint specifies a URI at which a browser-authenticated user may obtain a new authorization grant.
	OauthTokenEndpoint Item `jsonld:"oauthTokenEndpoint,omitempty"`
	// ProvideClientKey  If OAuth 2.0 bearer tokens [RFC6749] [RFC6750] are being used for authenticating client to server interactions,
	// this endpoint specifies a URI at which a client may acquire an access token.
	ProvideClientKey Item `jsonld:"provideClientKey,omitempty"`
	// SignClientKey If Linked Data Signatures and HTTP Signatures are being used for authentication and authorization,
	// this endpoint specifies a URI at which browser-authenticated users may authorize a client's public
	// key for client to server interactions.
	SignClientKey Item `jsonld:"signClientKey,omitempty"`
	// SharedInbox An optional endpoint used for wide delivery of publicly addressed activities and activities sent to followers.
	// SharedInbox endpoints SHOULD also be publicly readable OrderedCollection objects containing objects addressed to the
	// Public special collection. Reading from the sharedInbox endpoint MUST NOT present objects which are not addressed to the Public endpoint.
	SharedInbox Item `jsonld:"sharedInbox,omitempty"`
}

Endpoints a json object which maps additional (typically server/domain-wide) endpoints which may be useful either for this actor or someone referencing this actor. This mapping may be nested inside the actor document as the value or may be a link to a JSON-LD document with these properties.

func JSONGetActorEndpoints

func JSONGetActorEndpoints(val *fastjson.Value, prop string) *Endpoints

func (*Endpoints) GobDecode

func (e *Endpoints) GobDecode(data []byte) error

func (Endpoints) GobEncode

func (e Endpoints) GobEncode() ([]byte, error)

func (Endpoints) MarshalJSON

func (e Endpoints) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Endpoints) UnmarshalJSON

func (e *Endpoints) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Event

type Event = Object

Event represents any kind of event.

type Flag

type Flag = Activity

Flag indicates that the actor is "flagging" the object. Flagging is defined in the sense common to many social platforms as reporting content as being inappropriate for any number of reasons.

func FlagNew

func FlagNew(id ID, ob Item) *Flag

FlagNew initializes a Flag activity

type Follow

type Follow = Activity

Follow indicates that the actor is "following" the object. Following is defined in the sense typically used within Social systems in which the actor is interested in any activity performed by or on the object. The target and origin typically have no defined meaning.

func FollowNew

func FollowNew(id ID, ob Item) *Follow

FollowNew initializes a Follow activity

type FollowersCollection

type FollowersCollection = Collection

FollowersCollection is a collection of followers

type FollowingCollection

type FollowingCollection = Collection

FollowingCollection is a list of everybody that the actor has followed, added as a side effect. The following collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

type Group

type Group = Actor

Group represents a formal or informal collective of Actors.

func GroupNew

func GroupNew(id ID) *Group

GroupNew initializes a Group type actor

type HasRecipients

type HasRecipients interface {
	// Recipients is a method that should do a recipients de-duplication step and then return
	// the remaining recipients
	Recipients() ItemCollection
	Clean()
}

HasRecipients is an interface implemented by activities to return their audience for further propagation

type ID

type ID = IRI

ID designates a unique global identifier. All Objects in [ActivityStreams] should have unique global identifiers. ActivityPub extends this requirement; all objects distributed by the ActivityPub protocol MUST have unique global identifiers, unless they are intentionally transient (short-lived activities that are not intended to be able to be looked up, such as some kinds of chat messages or game notifications). These identifiers must fall into one of the following groups:

1. Publicly de-referenceable URIs, such as HTTPS URIs, with their authority belonging to that of their originating server. (Publicly facing content SHOULD use HTTPS URIs). 2. An ID explicitly specified as the JSON null object, which implies an anonymous object (a part of its parent context)

func JSONGetID

func JSONGetID(val *fastjson.Value) ID

func (*ID) IsValid

func (i *ID) IsValid() bool

IsValid returns if the receiver pointer is not nil and if dereferenced it has a positive length.

type IRI

type IRI string

IRI is a Internationalized Resource Identifiers (IRIs) RFC3987

func IRIf

func IRIf(i IRI, t CollectionPath) IRI

IRIf formats an IRI from an existing IRI and the CollectionPath type

func JSONGetIRI

func JSONGetIRI(val *fastjson.Value, prop string) IRI

func (IRI) AddPath

func (i IRI) AddPath(el ...string) IRI

AddPath concatenates el elements as a path to i

func (IRI) Contains

func (i IRI) Contains(what IRI, checkScheme bool) bool

func (IRI) Equals

func (i IRI) Equals(with IRI, checkScheme bool) bool

Equals verifies if our receiver IRI is equals with the "with" IRI It ignores the protocol It tries to use the URL representation if possible and fallback to string comparison if unable to convert In URL representation checks hostname in a case insensitive way and the path and

func (IRI) Format

func (i IRI) Format(s fmt.State, verb rune)

func (IRI) GetID

func (i IRI) GetID() ID

GetID

func (i IRI) GetLink() IRI

GetLink

func (IRI) GetType

func (i IRI) GetType() ActivityVocabularyType

GetType

func (*IRI) GobDecode

func (i *IRI) GobDecode(data []byte) error

GobDecode

func (IRI) GobEncode

func (i IRI) GobEncode() ([]byte, error)

GobEncode

func (IRI) IsCollection

func (i IRI) IsCollection() bool

IsCollection returns false for IRI objects

func (i IRI) IsLink() bool

IsLink

func (IRI) IsObject

func (i IRI) IsObject() bool

IsObject

func (IRI) ItemsMatch

func (i IRI) ItemsMatch(col ...Item) bool

func (IRI) MarshalBinary

func (i IRI) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (IRI) MarshalJSON

func (i IRI) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (IRI) String

func (i IRI) String() string

String returns the String value of the IRI object

func (IRI) URL

func (i IRI) URL() (*url.URL, error)

URL

func (*IRI) UnmarshalBinary

func (i *IRI) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*IRI) UnmarshalJSON

func (i *IRI) UnmarshalJSON(s []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type IRIs

type IRIs []IRI

func (*IRIs) Append

func (i *IRIs) Append(r IRI) error

Append facilitates adding elements to IRI slices and ensures IRIs implements the Collection interface

func (*IRIs) Collection

func (i *IRIs) Collection() ItemCollection

func (IRIs) Contains

func (i IRIs) Contains(r IRI) bool

Contains verifies if IRIs array contains the received one

func (*IRIs) Count

func (i *IRIs) Count() uint

func (IRIs) GetID

func (i IRIs) GetID() ID

GetID returns the ID corresponding to ItemCollection

func (i IRIs) GetLink() IRI

GetLink returns the empty IRI

func (IRIs) GetType

func (i IRIs) GetType() ActivityVocabularyType

GetType returns the ItemCollection's type

func (*IRIs) GobDecode

func (i *IRIs) GobDecode(data []byte) error

func (IRIs) GobEncode

func (i IRIs) GobEncode() ([]byte, error)

GobEncode

func (IRIs) IsCollection

func (i IRIs) IsCollection() bool

IsCollection returns true for IRI slices

func (i IRIs) IsLink() bool

IsLink returns false for an ItemCollection object

func (IRIs) IsObject

func (i IRIs) IsObject() bool

IsObject returns true for a ItemCollection object

func (IRIs) MarshalJSON

func (i IRIs) MarshalJSON() ([]byte, error)

func (*IRIs) UnmarshalJSON

func (i *IRIs) UnmarshalJSON(data []byte) error

type Ignore

type Ignore = Activity

Ignore indicates that the actor is ignoring the object. The target and origin typically have no defined meaning.

func IgnoreNew

func IgnoreNew(id ID, ob Item) *Ignore

IgnoreNew initializes an Ignore activity

type Image

type Image = Document

Image An image document of any kind

type InboxStream

type InboxStream = OrderedCollection

InboxStream contains all activities received by the actor. The server SHOULD filter content according to the requester's permission. In general, the owner of an inbox is likely to be able to access all of their inbox contents. Depending on access control, some other content may be public, whereas other content may require authentication for non-owner users, if they can access the inbox at all.

type IntransitiveActivities

type IntransitiveActivities interface {
	IntransitiveActivity | Question
}

type IntransitiveActivity

type IntransitiveActivity struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// CanReceiveActivities describes one or more entities that either performed or are expected to perform the activity.
	// Any single activity can have multiple actors. The actor may be specified using an indirect Link.
	Actor CanReceiveActivities `jsonld:"actor,omitempty"`
	// Target describes the indirect object, or target, of the activity.
	// The precise meaning of the target is largely dependent on the type of action being described
	// but will often be the object of the English preposition "to".
	// For instance, in the activity "John added a movie to his wishlist",
	// the target of the activity is John's wishlist. An activity can have more than one target.
	Target Item `jsonld:"target,omitempty"`
	// Result describes the result of the activity. For instance, if a particular action results in the creation
	// of a new resource, the result property can be used to describe that new resource.
	Result Item `jsonld:"result,omitempty"`
	// Origin describes an indirect object of the activity from which the activity is directed.
	// The precise meaning of the origin is the object of the English preposition "from".
	// For instance, in the activity "John moved an item to List B from List A", the origin of the activity is "List A".
	Origin Item `jsonld:"origin,omitempty"`
	// Instrument identifies one or more objects used (or to be used) in the completion of an Activity.
	Instrument Item `jsonld:"instrument,omitempty"`
}

IntransitiveActivity Instances of IntransitiveActivity are a subtype of Activity representing intransitive actions. The object property is therefore inappropriate for these activities.

func FlattenIntransitiveActivityProperties

func FlattenIntransitiveActivityProperties(act *IntransitiveActivity) *IntransitiveActivity

FlattenIntransitiveActivityProperties flattens the Activity's properties from Object type to IRI

func IntransitiveActivityNew

func IntransitiveActivityNew(id ID, typ ActivityVocabularyType) *IntransitiveActivity

IntransitiveActivityNew initializes a intransitive activity

func ToIntransitiveActivity

func ToIntransitiveActivity(it Item) (*IntransitiveActivity, error)

ToIntransitiveActivity tries to convert it Item to an IntransitiveActivity object

func (*IntransitiveActivity) Clean

func (i *IntransitiveActivity) Clean()

Clean removes Bto and BCC properties

func (IntransitiveActivity) Equals

func (i IntransitiveActivity) Equals(with Item) bool

Equals verifies if our receiver Object is equals with the "with" Object

func (IntransitiveActivity) Format

func (i IntransitiveActivity) Format(s fmt.State, verb rune)

func (IntransitiveActivity) GetID

func (i IntransitiveActivity) GetID() ID

GetID returns the ID corresponding to the IntransitiveActivity object

func (i IntransitiveActivity) GetLink() IRI

GetLink returns the IRI corresponding to the IntransitiveActivity object

func (IntransitiveActivity) GetType

GetType returns the ActivityVocabulary type of the current Intransitive Activity

func (*IntransitiveActivity) GobDecode

func (i *IntransitiveActivity) GobDecode(data []byte) error

func (IntransitiveActivity) GobEncode

func (i IntransitiveActivity) GobEncode() ([]byte, error)

func (IntransitiveActivity) IsCollection

func (i IntransitiveActivity) IsCollection() bool

IsCollection returns false for IntransitiveActivity objects

func (i IntransitiveActivity) IsLink() bool

IsLink returns false for Activity objects

func (IntransitiveActivity) IsObject

func (i IntransitiveActivity) IsObject() bool

IsObject returns true for IntransitiveActivity objects

func (IntransitiveActivity) MarshalBinary

func (i IntransitiveActivity) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (IntransitiveActivity) MarshalJSON

func (i IntransitiveActivity) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*IntransitiveActivity) Recipients

func (i *IntransitiveActivity) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Activity's To, Bto, CC and BCC properties

func (*IntransitiveActivity) UnmarshalBinary

func (i *IntransitiveActivity) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*IntransitiveActivity) UnmarshalJSON

func (i *IntransitiveActivity) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Invite

type Invite = Offer

Invite is a specialization of Offer in which the actor is extending an invitation for the object to the target.

func InviteNew

func InviteNew(id ID, ob Item) *Invite

InviteNew initializes an Invite activity

type Item

type Item = ObjectOrLink

Item struct

func CopyItemProperties

func CopyItemProperties(to, from Item) (Item, error)

CopyItemProperties delegates to the correct per type functions for copying properties between matching Activity Objects

func Flatten

func Flatten(it Item) Item

Flatten checks if Item can be flattened to an IRI or array of IRIs and returns it if so

func FlattenProperties

func FlattenProperties(it Item) Item

FlattenProperties flattens the Item's properties from Object types to IRI

func FlattenToIRI

func FlattenToIRI(it Item) Item

FlattenToIRI checks if Item can be flatten to an IRI and returns it if so

func GetItemByType

func GetItemByType(typ ActivityVocabularyType) (Item, error)

func GobDecode

func GobDecode(data []byte) (Item, error)

func JSONGetItem

func JSONGetItem(val *fastjson.Value, prop string) Item

func JSONGetURIItem

func JSONGetURIItem(val *fastjson.Value, prop string) Item

func JSONItemsFn

func JSONItemsFn(val *fastjson.Value) (Item, error)

func JSONLoadItem

func JSONLoadItem(val *fastjson.Value) (Item, error)

func JSONUnmarshalToItem

func JSONUnmarshalToItem(val *fastjson.Value) Item

func UnmarshalJSON

func UnmarshalJSON(data []byte) (Item, error)

UnmarshalJSON tries to detect the type of the object in the json data and then outputs a matching ActivityStreams object, if possible

type ItemCollection

type ItemCollection []Item

ItemCollection represents an array of items

func FlattenItemCollection

func FlattenItemCollection(col ItemCollection) ItemCollection

FlattenItemCollection flattens an Item Collection to their respective IRIs

func ItemCollectionDeduplication

func ItemCollectionDeduplication(recCols ...*ItemCollection) ItemCollection

ItemCollectionDeduplication normalizes the received arguments lists into a single unified one

func JSONGetItems

func JSONGetItems(val *fastjson.Value, prop string) ItemCollection

func ToItemCollection

func ToItemCollection(it Item) (*ItemCollection, error)

ToItemCollection

func (*ItemCollection) Append

func (i *ItemCollection) Append(o Item) error

Append facilitates adding elements to Item arrays and ensures ItemCollection implements the Collection interface

func (*ItemCollection) Collection

func (i *ItemCollection) Collection() ItemCollection

Collection returns the current object as collection interface

func (ItemCollection) Contains

func (i ItemCollection) Contains(r Item) bool

Contains verifies if IRIs array contains the received one

func (*ItemCollection) Count

func (i *ItemCollection) Count() uint

Count returns the length of Items in the item collection

func (ItemCollection) Equals

func (i ItemCollection) Equals(with Item) bool

Equals

func (ItemCollection) First

func (i ItemCollection) First() Item

First returns the ID corresponding to ItemCollection

func (ItemCollection) GetID

func (i ItemCollection) GetID() ID

GetID returns the ID corresponding to ItemCollection

func (i ItemCollection) GetLink() IRI

GetLink returns the empty IRI

func (ItemCollection) GetType

GetType returns the ItemCollection's type

func (ItemCollection) IsCollection

func (i ItemCollection) IsCollection() bool

IsCollection returns true for ItemCollection arrays

func (i ItemCollection) IsLink() bool

IsLink returns false for an ItemCollection object

func (ItemCollection) IsObject

func (i ItemCollection) IsObject() bool

IsObject returns true for a ItemCollection object

func (ItemCollection) ItemsMatch

func (i ItemCollection) ItemsMatch(col ...Item) bool

ItemsMatch

func (ItemCollection) MarshalJSON

func (i ItemCollection) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (ItemCollection) Normalize

func (i ItemCollection) Normalize() Item

Normalize returns the first item if the collection contains only one, the full collection if the collection contains more than one item, or nil

func (*ItemCollection) Remove

func (i *ItemCollection) Remove(r Item)

Remove removes the r Item from the i ItemCollection if it contains it

type JSONUnmarshalerFn

type JSONUnmarshalerFn func(ActivityVocabularyType, *fastjson.Value, Item) error

JSONUnmarshalerFn is the type of the function that will load the data from a fastjson.Value into an Item that the current package doesn't know about.

var JSONItemUnmarshal JSONUnmarshalerFn = nil

JSONItemUnmarshal can be set externally to populate a custom object based on its type

type Join

type Join = Activity

Join indicates that the actor has joined the object. The target and origin typically have no defined meaning.

func JoinNew

func JoinNew(id ID, ob Item) *Join

JoinNew initializes a Join activity

type LangRef

type LangRef string

LangRef is the type for a language reference code, should be an ISO639-1 language specifier.

const NilLangRef LangRef = "-"

NilLangRef represents a convention for a nil language reference. It is used for LangRefValue objects without an explicit language key.

func JSONGetLangRefField

func JSONGetLangRefField(val *fastjson.Value, prop string) LangRef

func (*LangRef) GobDecode

func (l *LangRef) GobDecode(data []byte) error

func (LangRef) GobEncode

func (l LangRef) GobEncode() ([]byte, error)

func (LangRef) String

func (l LangRef) String() string

func (*LangRef) UnmarshalJSON

func (l *LangRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

func (*LangRef) UnmarshalText

func (l *LangRef) UnmarshalText(data []byte) error

UnmarshalText implements the TextEncoder interface

type LangRefValue

type LangRefValue struct {
	Ref   LangRef
	Value Content
}

LangRefValue is a type for storing per language values

func DefaultLangRef

func DefaultLangRef(value string) LangRefValue

func LangRefValueNew

func LangRefValueNew(lang LangRef, value string) LangRefValue

func (LangRefValue) Equals

func (l LangRefValue) Equals(other LangRefValue) bool

func (LangRefValue) Format

func (l LangRefValue) Format(s fmt.State, verb rune)

func (*LangRefValue) GobDecode

func (l *LangRefValue) GobDecode(data []byte) error

func (LangRefValue) GobEncode

func (l LangRefValue) GobEncode() ([]byte, error)

func (LangRefValue) MarshalJSON

func (l LangRefValue) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (LangRefValue) MarshalText

func (l LangRefValue) MarshalText() ([]byte, error)

MarshalText serializes the LangRefValue into JSON

func (LangRefValue) String

func (l LangRefValue) String() string

String adds support for Stringer interface. It returns the Value[LangRef] text or just Value if LangRef is NIL

func (*LangRefValue) UnmarshalJSON

func (l *LangRefValue) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

func (*LangRefValue) UnmarshalText

func (l *LangRefValue) UnmarshalText(data []byte) error

UnmarshalText implements the TextEncoder interface

type Leave

type Leave = Activity

Leave indicates that the actor has left the object. The target and origin typically have no meaning.

func LeaveNew

func LeaveNew(id ID, ob Item) *Leave

LeaveNew initializes a Leave activity

type Like

type Like = Activity

Like indicates that the actor likes, recommends or endorses the object. The target and origin typically have no defined meaning.

func LikeNew

func LikeNew(id ID, ob Item) *Like

LikeNew initializes a Like activity

type LikedCollection

type LikedCollection = OrderedCollection

LikedCollection is a list of every object from all of the actor's Like activities, added as a side effect. The liked collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

type LikesCollection

type LikesCollection = OrderedCollection

LikesCollection is a list of all Like activities with this object as the object property, added as a side effect. The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

type Link struct {
	// Provides the globally unique identifier for an APObject or Link.
	ID ID `jsonld:"id,omitempty"`
	// Identifies the APObject or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// A simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// A link relation associated with a Link. The value must conform to both the [HTML5] and
	// [RFC5988](https://tools.ietf.org/html/rfc5988) "link relation" definitions.
	// In the [HTML5], any string not containing the "space" U+0020, "tab" (U+0009), "LF" (U+000A),
	// "FF" (U+000C), "CR" (U+000D) or "," (U+002C) characters can be used as a valid link relation.
	Rel IRI `jsonld:"rel,omitempty"`
	// When used on a Link, identifies the MIME media type of the referenced resource.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// On a Link, specifies a hint as to the rendering height in device-independent pixels of the linked resource.
	Height uint `jsonld:"height,omitempty"`
	// On a Link, specifies a hint as to the rendering width in device-independent pixels of the linked resource.
	Width uint `jsonld:"width,omitempty"`
	// Identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// The target resource pointed to by a Link.
	Href IRI `jsonld:"href,omitempty"`
	// Hints as to the language used by the target resource.
	// Value must be a [BCP47](https://tools.ietf.org/html/bcp47) Language-Tag.
	HrefLang LangRef `jsonld:"hrefLang,omitempty"`
}

A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [ RFC5988]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of APObject or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href. Properties of the Link are properties of the reference as opposed to properties of the resource.

func LinkNew

func LinkNew(id ID, typ ActivityVocabularyType) *Link

LinkNew initializes a new Link

func ToLink(it LinkOrIRI) (*Link, error)

ToLink returns a Link pointer to the data in the current Item

func (Link) Format

func (l Link) Format(s fmt.State, verb rune)

func (Link) GetID

func (l Link) GetID() ID

GetID returns the ID corresponding to the Link object

func (l Link) GetLink() IRI

GetLink returns the IRI corresponding to the current Link

func (Link) GetType

func (l Link) GetType() ActivityVocabularyType

GetType returns the Type corresponding to the Mention object

func (*Link) GobDecode

func (l *Link) GobDecode(data []byte) error

func (Link) GobEncode

func (l Link) GobEncode() ([]byte, error)

func (Link) IsCollection

func (l Link) IsCollection() bool

IsCollection returns false for Link objects

func (l Link) IsLink() bool

IsLink validates if current Link is a Link

func (Link) IsObject

func (l Link) IsObject() bool

IsObject validates if current Link is an GetID

func (Link) MarshalBinary

func (l Link) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Link) MarshalJSON

func (l Link) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Link) UnmarshalBinary

func (l *Link) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Link) UnmarshalJSON

func (l *Link) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type LinkOrIRI

type LinkOrIRI interface {
	// GetLink returns the object id in IRI type
	GetLink() IRI
}

LinkOrIRI is an interface that Object and Link structs implement, and at the same time they are kept disjointed

type Links interface {
	Link | IRI
}

type Listen

type Listen = Activity

Listen inherits all properties from Activity.

func ListenNew

func ListenNew(id ID, ob Item) *Listen

ListenNew initializes a Listen activity

type Mapper

type Mapper interface {
	// FromActivityStreams maps an ActivityStreams object to another struct representation
	FromActivityStreams(Item) error
}

Mapper interface allows external objects to implement their own mechanism for loading information from an ActivityStreams vocabulary object

type Mention

type Mention = Link

Mention is a specialized Link that represents an @mention.

func MentionNew

func MentionNew(id ID) *Mention

MentionNew initializes a new Mention

type MimeType

type MimeType string

MimeType is the type for representing MIME types in certain ActivityStreams properties

func JSONGetMimeType

func JSONGetMimeType(val *fastjson.Value, prop string) MimeType

func (*MimeType) GobDecode

func (m *MimeType) GobDecode(data []byte) error

GobDecode

func (MimeType) GobEncode

func (m MimeType) GobEncode() ([]byte, error)

GobEncode

func (MimeType) MarshalBinary

func (m MimeType) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (MimeType) MarshalJSON

func (m MimeType) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*MimeType) UnmarshalBinary

func (m *MimeType) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*MimeType) UnmarshalJSON

func (m *MimeType) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Move

type Move = Activity

Move indicates that the actor has moved object from origin to target. If the origin or target are not specified, either can be determined by context.

func MoveNew

func MoveNew(id ID, ob Item) *Move

MoveNew initializes a Move activity

type NaturalLanguageValues

type NaturalLanguageValues []LangRefValue

NaturalLanguageValues is a mapping for multiple language values

func DefaultNaturalLanguageValue

func DefaultNaturalLanguageValue(content string) NaturalLanguageValues

func JSONGetNaturalLanguageField

func JSONGetNaturalLanguageField(val *fastjson.Value, prop string) NaturalLanguageValues

func NaturalLanguageValuesNew

func NaturalLanguageValuesNew(values ...LangRefValue) NaturalLanguageValues

func (*NaturalLanguageValues) Add

func (n *NaturalLanguageValues) Add(ref LangRefValue)

func (*NaturalLanguageValues) Append

func (n *NaturalLanguageValues) Append(lang LangRef, value Content) error

Append is syntactic sugar for resizing the NaturalLanguageValues map and appending an element

func (*NaturalLanguageValues) Count

func (n *NaturalLanguageValues) Count() uint

Count returns the length of Items in the item collection

func (NaturalLanguageValues) Equals

Equals

func (NaturalLanguageValues) First

First returns the first element in the array

func (NaturalLanguageValues) Format

func (n NaturalLanguageValues) Format(s fmt.State, verb rune)

func (NaturalLanguageValues) Get

func (*NaturalLanguageValues) GobDecode

func (n *NaturalLanguageValues) GobDecode(data []byte) error

func (NaturalLanguageValues) GobEncode

func (n NaturalLanguageValues) GobEncode() ([]byte, error)

func (NaturalLanguageValues) MarshalJSON

func (n NaturalLanguageValues) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (NaturalLanguageValues) MarshalText

func (n NaturalLanguageValues) MarshalText() ([]byte, error)

MarshalText serializes the NaturalLanguageValues into Text

func (*NaturalLanguageValues) Set

func (n *NaturalLanguageValues) Set(ref LangRef, v Content) error

Set sets a language, value pair in a NaturalLanguageValues array

func (NaturalLanguageValues) String

func (n NaturalLanguageValues) String() string

func (*NaturalLanguageValues) UnmarshalJSON

func (n *NaturalLanguageValues) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

func (*NaturalLanguageValues) UnmarshalText

func (n *NaturalLanguageValues) UnmarshalText(data []byte) error

UnmarshalText tries to load the NaturalLanguage array from the incoming Text value

type NotEmptyCheckerFn

type NotEmptyCheckerFn func(Item) bool

NotEmptyCheckerFn is the type of a function that checks if an object is empty

var NotEmptyChecker NotEmptyCheckerFn = NotEmpty

NotEmptyChecker checks if an object is empty

type Note

type Note = Object

Note represents a short written work typically less than a single paragraph in length.

type Object

type Object struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
}

Object describes an ActivityPub object of any kind. It serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection.

func CopyObjectProperties

func CopyObjectProperties(old, new *Object) (*Object, error)

CopyObjectProperties updates the "old" object properties with "new's"

func FlattenObjectProperties

func FlattenObjectProperties(o *Object) *Object

FlattenObjectProperties flattens the Object's properties from Object types to IRI

func ObjectNew

func ObjectNew(typ ActivityVocabularyType) *Object

ObjectNew initializes a new Object

func ToObject

func ToObject(it Item) (*Object, error)

ToObject returns an Object pointer to the data in the current Item It relies on the fact that all the types in this package have a data layout compatible with Object.

func (*Object) Clean

func (o *Object) Clean()

Clean removes Bto and BCC properties

func (Object) Equals

func (o Object) Equals(with Item) bool

Equals verifies if our receiver Object is equals with the "with" Object

func (Object) Format

func (o Object) Format(s fmt.State, verb rune)

func (Object) GetID

func (o Object) GetID() ID

GetID returns the ID corresponding to the current Object

func (o Object) GetLink() IRI

GetLink returns the IRI corresponding to the current Object

func (Object) GetType

func (o Object) GetType() ActivityVocabularyType

GetType returns the type of the current Object

func (*Object) GobDecode

func (o *Object) GobDecode(data []byte) error

GobDecode

func (Object) GobEncode

func (o Object) GobEncode() ([]byte, error)

GobEncode

func (Object) IsCollection

func (o Object) IsCollection() bool

IsCollection returns false for Object objects

func (o Object) IsLink() bool

IsLink validates if currentActivity Pub Object is a Link

func (Object) IsObject

func (o Object) IsObject() bool

IsObject validates if currentActivity Pub Object is an Object

func (Object) MarshalBinary

func (o Object) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Object) MarshalJSON

func (o Object) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Object) Recipients

func (o *Object) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Object's To, Bto, CC and BCC properties

func (*Object) UnmarshalBinary

func (o *Object) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Object) UnmarshalJSON

func (o *Object) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type ObjectOrLink interface {
	ActivityObject
	LinkOrIRI
	// IsLink shows if current item represents a Link object or an IRI
	IsLink() bool
	// IsObject shows if current item represents an ActivityStreams object
	IsObject() bool
	// IsCollection shows if the current item represents an ItemCollection
	IsCollection() bool
}

ObjectOrLink describes the requirements of an ActivityStreams object

type Offer

type Offer = Activity

Offer indicates that the actor is offering the object. If specified, the target indicates the entity to which the object is being offered.

func OfferNew

func OfferNew(id ID, ob Item) *Offer

OfferNew initializes an Offer activity

type OrderedCollection

type OrderedCollection struct {
	// ID provides the globally unique identifier for an Activity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// In a paged Collection, indicates the page that contains the most recently updated member items.
	Current ObjectOrLink `jsonld:"current,omitempty"`
	// In a paged Collection, indicates the furthest preceding page of items in the collection.
	First ObjectOrLink `jsonld:"first,omitempty"`
	// In a paged Collection, indicates the furthest proceeding page of the collection.
	Last ObjectOrLink `jsonld:"last,omitempty"`
	// A non-negative integer specifying the total number of objects contained by the logical view of the collection.
	// This number might not reflect the actual number of items serialized within the Collection object instance.
	TotalItems uint `jsonld:"totalItems"`
	// Identifies the items contained in a collection. The items might be ordered or unordered.
	OrderedItems ItemCollection `jsonld:"orderedItems,omitempty"`
}

OrderedCollection is a subtype of Collection in which members of the logical collection are assumed to always be strictly ordered.

func CopyOrderedCollectionProperties

func CopyOrderedCollectionProperties(old, new *OrderedCollection) (*OrderedCollection, error)

func FlattenOrderedCollection

func FlattenOrderedCollection(col *OrderedCollection) *OrderedCollection

FlattenOrderedCollection flattens an OrderedCollection's objects to their respective IRIs

func OrderedCollectionNew

func OrderedCollectionNew(id ID) *OrderedCollection

OrderedCollectionNew initializes a new OrderedCollection

func ToOrderedCollection

func ToOrderedCollection(it Item) (*OrderedCollection, error)

ToOrderedCollection

func (*OrderedCollection) Append

func (o *OrderedCollection) Append(ob Item) error

Append adds an element to an the receiver collection object.

func (OrderedCollection) Collection

func (o OrderedCollection) Collection() ItemCollection

Collection returns the underlying Collection type

func (OrderedCollection) Contains

func (o OrderedCollection) Contains(r Item) bool

Contains verifies if OrderedCollection array contains the received item r.

func (*OrderedCollection) Count

func (o *OrderedCollection) Count() uint

Count returns the maximum between the length of Items in collection and its TotalItems property

func (OrderedCollection) Equals

func (o OrderedCollection) Equals(with Item) bool

Equals

func (OrderedCollection) Format

func (o OrderedCollection) Format(s fmt.State, verb rune)

func (OrderedCollection) GetID

func (o OrderedCollection) GetID() ID

GetID returns the ID corresponding to the OrderedCollection

func (o OrderedCollection) GetLink() IRI

GetLink returns the IRI corresponding to the OrderedCollection object

func (OrderedCollection) GetType

GetType returns the OrderedCollection's type

func (*OrderedCollection) GobDecode

func (o *OrderedCollection) GobDecode(data []byte) error

GobDecode

func (OrderedCollection) GobEncode

func (o OrderedCollection) GobEncode() ([]byte, error)

GobEncode

func (OrderedCollection) IsCollection

func (o OrderedCollection) IsCollection() bool

IsCollection returns true for OrderedCollection objects.

func (o OrderedCollection) IsLink() bool

IsLink returns false for an OrderedCollection object

func (OrderedCollection) IsObject

func (o OrderedCollection) IsObject() bool

IsObject returns true for am OrderedCollection object

func (OrderedCollection) ItemsMatch

func (o OrderedCollection) ItemsMatch(col ...Item) bool

ItemsMatch

func (OrderedCollection) MarshalBinary

func (o OrderedCollection) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (OrderedCollection) MarshalJSON

func (o OrderedCollection) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*OrderedCollection) UnmarshalBinary

func (o *OrderedCollection) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*OrderedCollection) UnmarshalJSON

func (o *OrderedCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type OrderedCollectionPage

type OrderedCollectionPage struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// In a paged Collection, indicates the page that contains the most recently updated member items.
	Current ObjectOrLink `jsonld:"current,omitempty"`
	// In a paged Collection, indicates the furthest preceding page of items in the collection.
	First ObjectOrLink `jsonld:"first,omitempty"`
	// In a paged Collection, indicates the furthest proceeding page of the collection.
	Last ObjectOrLink `jsonld:"last,omitempty"`
	// A non-negative integer specifying the total number of objects contained by the logical view of the collection.
	// This number might not reflect the actual number of items serialized within the Collection object instance.
	TotalItems uint `jsonld:"totalItems"`
	// Identifies the items contained in a collection. The items might be ordered or unordered.
	OrderedItems ItemCollection `jsonld:"orderedItems,omitempty"`
	// Identifies the Collection to which a CollectionPage objects items belong.
	PartOf Item `jsonld:"partOf,omitempty"`
	// In a paged Collection, indicates the next page of items.
	Next Item `jsonld:"next,omitempty"`
	// In a paged Collection, identifies the previous page of items.
	Prev Item `jsonld:"prev,omitempty"`
	// A non-negative integer value identifying the relative position within the logical view of a strictly ordered collection.
	StartIndex uint `jsonld:"startIndex,omitempty"`
}

OrderedCollectionPage type extends from both CollectionPage and OrderedCollection. In addition to the properties inherited from each of those, the OrderedCollectionPage may contain an additional startIndex property whose value indicates the relative index position of the first item contained by the page within the OrderedCollection to which the page belongs.

func CopyOrderedCollectionPageProperties

func CopyOrderedCollectionPageProperties(old, new *OrderedCollectionPage) (*OrderedCollectionPage, error)

func OrderedCollectionPageNew

func OrderedCollectionPageNew(parent CollectionInterface) *OrderedCollectionPage

OrderedCollectionPageNew initializes a new OrderedCollectionPage

func ToOrderedCollectionPage

func ToOrderedCollectionPage(it Item) (*OrderedCollectionPage, error)

ToOrderedCollectionPage

func (*OrderedCollectionPage) Append

func (o *OrderedCollectionPage) Append(ob Item) error

Append adds an element to an OrderedCollectionPage

func (OrderedCollectionPage) Collection

func (o OrderedCollectionPage) Collection() ItemCollection

Collection returns the underlying Collection type

func (OrderedCollectionPage) Contains

func (o OrderedCollectionPage) Contains(r Item) bool

Contains verifies if OrderedCollectionPage array contains the received one

func (*OrderedCollectionPage) Count

func (o *OrderedCollectionPage) Count() uint

Count returns the maximum between the length of Items in the collection page and its TotalItems property

func (OrderedCollectionPage) Equals

func (o OrderedCollectionPage) Equals(with Item) bool

Equals

func (OrderedCollectionPage) Format

func (o OrderedCollectionPage) Format(s fmt.State, verb rune)

func (OrderedCollectionPage) GetID

func (o OrderedCollectionPage) GetID() ID

GetID returns the ID corresponding to the OrderedCollectionPage object

func (o OrderedCollectionPage) GetLink() IRI

GetLink returns the IRI corresponding to the OrderedCollectionPage object

func (OrderedCollectionPage) GetType

GetType returns the OrderedCollectionPage's type

func (*OrderedCollectionPage) GobDecode

func (o *OrderedCollectionPage) GobDecode(data []byte) error

GobDecode

func (OrderedCollectionPage) GobEncode

func (o OrderedCollectionPage) GobEncode() ([]byte, error)

GobEncode

func (OrderedCollectionPage) IsCollection

func (o OrderedCollectionPage) IsCollection() bool

IsCollection returns true for OrderedCollectionPage objects

func (o OrderedCollectionPage) IsLink() bool

IsLink returns false for a OrderedCollectionPage object

func (OrderedCollectionPage) IsObject

func (o OrderedCollectionPage) IsObject() bool

IsObject returns true for a OrderedCollectionPage object

func (OrderedCollectionPage) ItemsMatch

func (o OrderedCollectionPage) ItemsMatch(col ...Item) bool

ItemsMatch

func (OrderedCollectionPage) MarshalBinary

func (o OrderedCollectionPage) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (OrderedCollectionPage) MarshalJSON

func (o OrderedCollectionPage) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*OrderedCollectionPage) UnmarshalBinary

func (o *OrderedCollectionPage) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*OrderedCollectionPage) UnmarshalJSON

func (o *OrderedCollectionPage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Organization

type Organization = Actor

Organization represents an organization.

func OrganizationNew

func OrganizationNew(id ID) *Organization

OrganizationNew initializes an Organization type actor

type OutboxStream

type OutboxStream = OrderedCollection

OutboxStream contains activities the user has published, subject to the ability of the requestor to retrieve the activity (that is, the contents of the outbox are filtered by the permissions of the person reading it).

type Page

type Page = Document

Page represents a Web Page.

type Person

type Person = Actor

Person represents an individual person.

func PersonNew

func PersonNew(id ID) *Person

PersonNew initializes a Person type actor

type Place

type Place struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// Accuracy indicates the accuracy of position coordinates on a Place objects.
	// Expressed in properties of percentage. e.g. "94.0" means "94.0% accurate".
	Accuracy float64 `jsonld:"accuracy,omitempty"`
	// Altitude indicates the altitude of a place. The measurement units is indicated using the units property.
	// If units is not specified, the default is assumed to be "m" indicating meters.
	Altitude float64 `jsonld:"altitude,omitempty"`
	// Latitude the latitude of a place
	Latitude float64 `jsonld:"latitude,omitempty"`
	// Longitude the longitude of a place
	Longitude float64 `jsonld:"longitude,omitempty"`
	// Radius the radius from the given latitude and longitude for a Place.
	// The units is expressed by the units property. If units is not specified,
	// the default is assumed to be "m" indicating "meters".
	Radius int64 `jsonld:"radius,omitempty"`
	// Specifies the measurement units for the radius and altitude properties on a Place object.
	// If not specified, the default is assumed to be "m" for "meters".
	// Values "cm" | " feet" | " inches" | " km" | " m" | " miles" | xsd:anyURI
	Units string `jsonld:"units,omitempty"`
}

Place represents a logical or physical location. See 5.3 Representing Places for additional information.

func ToPlace

func ToPlace(it Item) (*Place, error)

ToPlace

func (*Place) Clean

func (p *Place) Clean()

Clean removes Bto and BCC properties

func (Place) Format

func (p Place) Format(s fmt.State, verb rune)

func (Place) GetID

func (p Place) GetID() ID

GetID returns the ID corresponding to the current Place

func (p Place) GetLink() IRI

GetLink returns the IRI corresponding to the current Place object

func (Place) GetType

func (p Place) GetType() ActivityVocabularyType

GetType returns the type of the current Place

func (*Place) GobDecode

func (p *Place) GobDecode(data []byte) error

GobDecode

func (Place) GobEncode

func (p Place) GobEncode() ([]byte, error)

GobEncode

func (Place) IsCollection

func (p Place) IsCollection() bool

IsCollection returns false for Place objects

func (p Place) IsLink() bool

IsLink returns false for Place objects

func (Place) IsObject

func (p Place) IsObject() bool

IsObject returns true for Place objects

func (Place) MarshalBinary

func (p Place) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Place) MarshalJSON

func (p Place) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Place) Recipients

func (p *Place) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Place object's To, Bto, CC and BCC properties

func (*Place) UnmarshalBinary

func (p *Place) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Place) UnmarshalJSON

func (p *Place) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Profile

type Profile struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// Describes On a Profile object, the describes property identifies the object described by the Profile.
	Describes Item `jsonld:"describes,omitempty"`
}

Profile a Profile is a content object that describes another Object, typically used to describe CanReceiveActivities Type objects. The describes property is used to reference the object being described by the profile.

func ToProfile

func ToProfile(it Item) (*Profile, error)

ToProfile tries to convert the it Item to a Profile object

func (*Profile) Clean

func (p *Profile) Clean()

Clean removes Bto and BCC properties

func (Profile) Format

func (p Profile) Format(s fmt.State, verb rune)

func (Profile) GetID

func (p Profile) GetID() ID

GetID returns the ID corresponding to the current Profile

func (p Profile) GetLink() IRI

GetLink returns the IRI corresponding to the current Profile object

func (Profile) GetType

func (p Profile) GetType() ActivityVocabularyType

GetType returns the type of the current Profile

func (*Profile) GobDecode

func (p *Profile) GobDecode(data []byte) error

GobDecode

func (Profile) GobEncode

func (p Profile) GobEncode() ([]byte, error)

GobEncode

func (Profile) IsCollection

func (p Profile) IsCollection() bool

IsCollection returns false for Profile objects

func (p Profile) IsLink() bool

IsLink returns false for Profile objects

func (Profile) IsObject

func (p Profile) IsObject() bool

IsObject returns true for Profile objects

func (Profile) MarshalBinary

func (p Profile) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Profile) MarshalJSON

func (p Profile) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Profile) Recipients

func (p *Profile) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Profile object's To, Bto, CC and BCC properties

func (*Profile) UnmarshalBinary

func (p *Profile) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Profile) UnmarshalJSON

func (p *Profile) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type PublicKey

type PublicKey struct {
	ID           ID     `jsonld:"id,omitempty"`
	Owner        IRI    `jsonld:"owner,omitempty"`
	PublicKeyPem string `jsonld:"publicKeyPem,omitempty"`
}

PublicKey holds the ActivityPub compatible public key data The document reference can be found at: https://web-payments.org/vocabs/security#publicKey

func JSONGetPublicKey

func JSONGetPublicKey(val *fastjson.Value, prop string) PublicKey

func (*PublicKey) GobDecode

func (p *PublicKey) GobDecode(data []byte) error

func (PublicKey) GobEncode

func (p PublicKey) GobEncode() ([]byte, error)

func (PublicKey) MarshalJSON

func (p PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) UnmarshalJSON

func (p *PublicKey) UnmarshalJSON(data []byte) error

type Question

type Question struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// CanReceiveActivities describes one or more entities that either performed or are expected to perform the activity.
	// Any single activity can have multiple actors. The actor may be specified using an indirect Link.
	Actor CanReceiveActivities `jsonld:"actor,omitempty"`
	// Target describes the indirect object, or target, of the activity.
	// The precise meaning of the target is largely dependent on the type of action being described
	// but will often be the object of the English preposition "to".
	// For instance, in the activity "John added a movie to his wishlist",
	// the target of the activity is John's wishlist. An activity can have more than one target.
	Target Item `jsonld:"target,omitempty"`
	// Result describes the result of the activity. For instance, if a particular action results in the creation
	// of a new resource, the result property can be used to describe that new resource.
	Result Item `jsonld:"result,omitempty"`
	// Origin describes an indirect object of the activity from which the activity is directed.
	// The precise meaning of the origin is the object of the English preposition "from".
	// For instance, in the activity "John moved an item to List B from List A", the origin of the activity is "List A".
	Origin Item `jsonld:"origin,omitempty"`
	// Instrument identifies one or more objects used (or to be used) in the completion of an Activity.
	Instrument Item `jsonld:"instrument,omitempty"`
	// OneOf identifies an exclusive option for a Question. Use of oneOf implies that the Question
	// can have only a single answer. To indicate that a Question can have multiple answers, use anyOf.
	OneOf Item `jsonld:"oneOf,omitempty"`
	// AnyOf identifies an inclusive option for a Question. Use of anyOf implies that the Question can have multiple answers.
	// To indicate that a Question can have only one answer, use oneOf.
	AnyOf Item `jsonld:"anyOf,omitempty"`
	// Closed indicates that a question has been closed, and answers are no longer accepted.
	Closed bool `jsonld:"closed,omitempty"`
}

Question represents a question being asked. Question objects are an extension of IntransitiveActivity. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property. Either of the anyOf and oneOf properties may be used to express possible answers, but a Question object must not have both properties.

func QuestionNew

func QuestionNew(id ID) *Question

QuestionNew initializes a Question activity

func ToQuestion

func ToQuestion(it Item) (*Question, error)

ToQuestion tries to convert the it Item to a Question object.

func (Question) Format

func (q Question) Format(s fmt.State, verb rune)

func (Question) GetID

func (q Question) GetID() ID

GetID returns the ID corresponding to the Question object

func (q Question) GetLink() IRI

GetLink returns the IRI corresponding to the Question object

func (Question) GetType

func (q Question) GetType() ActivityVocabularyType

GetType returns the ActivityVocabulary type of the current Activity

func (*Question) GobDecode

func (q *Question) GobDecode(data []byte) error

GobDecode

func (Question) GobEncode

func (q Question) GobEncode() ([]byte, error)

GobEncode

func (Question) IsCollection

func (q Question) IsCollection() bool

IsCollection returns false for Question objects

func (q Question) IsLink() bool

IsLink returns false for Question objects

func (Question) IsObject

func (q Question) IsObject() bool

IsObject returns true for Question objects

func (Question) MarshalBinary

func (q Question) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Question) MarshalJSON

func (q Question) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Question) UnmarshalBinary

func (q *Question) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Question) UnmarshalJSON

func (q *Question) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Read

type Read = Activity

Read indicates that the actor has read the object.

func ReadNew

func ReadNew(id ID, ob Item) *Read

ReadNew initializes a Read activity

type Reject

type Reject = Activity

Reject indicates that the actor is rejecting the object. The target and origin typically have no defined meaning.

func RejectNew

func RejectNew(id ID, ob Item) *Reject

RejectNew initializes a Reject activity

type Relationship

type Relationship struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// Subject Subject On a Relationship object, the subject property identifies one of the connected individuals.
	// For instance, for a Relationship object describing "John is related to Sally", subject would refer to John.
	Subject Item `jsonld:"subject,omitempty"`
	// Object
	Object Item `jsonld:"object,omitempty"`
	// Relationship On a Relationship object, the relationship property identifies the kind
	// of relationship that exists between subject and object.
	Relationship Item `jsonld:"relationship,omitempty"`
}

Relationship describes a relationship between two individuals. The subject and object properties are used to identify the connected individuals. See 5.2 Representing Relationships Between Entities for additional information.

5.2: The relationship property specifies the kind of relationship that exists between the two individuals identified
by the subject and object properties. Used together, these three properties form what is commonly known
as a "reified statement" where subject identifies the subject, relationship identifies the predicate,
and object identifies the object.

func ToRelationship

func ToRelationship(it Item) (*Relationship, error)

ToRelationship tries to convert the it Item to a Relationship object.

func (*Relationship) Clean

func (r *Relationship) Clean()

Clean removes Bto and BCC properties

func (Relationship) Format

func (r Relationship) Format(s fmt.State, verb rune)

func (Relationship) GetID

func (r Relationship) GetID() ID

GetID returns the ID corresponding to the current Relationship

func (r Relationship) GetLink() IRI

GetLink returns the IRI corresponding to the current Relationship object

func (Relationship) GetType

GetType returns the type of the current Relationship

func (*Relationship) GobDecode

func (r *Relationship) GobDecode(data []byte) error

GobDecode

func (Relationship) GobEncode

func (r Relationship) GobEncode() ([]byte, error)

GobEncode

func (Relationship) IsCollection

func (r Relationship) IsCollection() bool

IsCollection returns false for Relationship objects

func (r Relationship) IsLink() bool

IsLink returns false for Relationship objects

func (Relationship) IsObject

func (r Relationship) IsObject() bool

IsObject returns true for Relationship objects

func (Relationship) MarshalBinary

func (r Relationship) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Relationship) MarshalJSON

func (r Relationship) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Relationship) Recipients

func (r *Relationship) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Relationship object's To, Bto, CC and BCC properties

func (*Relationship) UnmarshalBinary

func (r *Relationship) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Relationship) UnmarshalJSON

func (r *Relationship) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Remove

type Remove = Activity

Remove indicates that the actor is removing the object. If specified, the origin indicates the context from which the object is being removed.

func RemoveNew

func RemoveNew(id ID, ob Item, trgt Item) *Remove

RemoveNew initializes a Remove activity

type Service

type Service = Actor

Service represents a service of any kind.

func ServiceNew

func ServiceNew(id ID) *Service

ServiceNew initializes a Service type actor

type SharesCollection

type SharesCollection = OrderedCollection

SharesCollection is a list of all Announce activities with this object as the object property, added as a side effect. The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

type Source

type Source struct {
	// Content
	Content NaturalLanguageValues `jsonld:"content"`
	// MediaType
	MediaType MimeType `jsonld:"mediaType"`
}

Source is intended to convey some sort of source from which the content markup was derived, as a form of provenance, or to support future editing by clients.

func GetAPSource

func GetAPSource(val *fastjson.Value) Source

GetAPSource

func (*Source) GobDecode

func (s *Source) GobDecode(data []byte) error

GobDecode

func (Source) GobEncode

func (s Source) GobEncode() ([]byte, error)

GobEncode

func (Source) MarshalBinary

func (s Source) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Source) MarshalJSON

func (s Source) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Source) UnmarshalBinary

func (s *Source) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type TentativeAccept

type TentativeAccept = Accept

TentativeAccept is a specialization of Accept indicating that the acceptance is tentative.

func TentativeAcceptNew

func TentativeAcceptNew(id ID, ob Item) *TentativeAccept

TentativeAcceptNew initializes a TentativeAccept activity

type TentativeReject

type TentativeReject = Reject

TentativeReject is a specialization of Reject in which the rejection is considered tentative.

func TentativeRejectNew

func TentativeRejectNew(id ID, ob Item) *TentativeReject

TentativeRejectNew initializes a TentativeReject activity

type Tombstone

type Tombstone struct {
	// ID provides the globally unique identifier for anActivity Pub Object or Link.
	ID ID `jsonld:"id,omitempty"`
	// Type identifies the Activity Pub Object or Link type. Multiple values may be specified.
	Type ActivityVocabularyType `jsonld:"type,omitempty"`
	// Name a simple, human-readable, plain-text name for the object.
	// HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
	Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"`
	// Attachment identifies a resource attached or related to an object that potentially requires special handling.
	// The intent is to provide a model that is at least semantically similar to attachments in email.
	Attachment Item `jsonld:"attachment,omitempty"`
	// AttributedTo identifies one or more entities to which this object is attributed. The attributed entities might not be Actors.
	// For instance, an object might be attributed to the completion of another activity.
	AttributedTo Item `jsonld:"attributedTo,omitempty"`
	// Audience identifies one or more entities that represent the total population of entities
	// for which the object can considered to be relevant.
	Audience ItemCollection `jsonld:"audience,omitempty"`
	// Content or textual representation of the Activity Pub Object encoded as a JSON string.
	// By default, the value of content is HTML.
	// The mediaType property can be used in the object to indicate a different content type.
	// (The content MAY be expressed using multiple language-tagged values.)
	Content NaturalLanguageValues `jsonld:"content,omitempty,collapsible"`
	// Context identifies the context within which the object exists or an activity was performed.
	// The notion of "context" used is intentionally vague.
	// The intended function is to serve as a means of grouping objects and activities that share a
	// common originating context or purpose. An example could be all activities relating to a common project or event.
	Context Item `jsonld:"context,omitempty"`
	// MediaType when used on an Object, identifies the MIME media type of the value of the content property.
	// If not specified, the content property is assumed to contain text/html content.
	MediaType MimeType `jsonld:"mediaType,omitempty"`
	// EndTime the date and time describing the actual or expected ending time of the object.
	// When used with an Activity object, for instance, the endTime property specifies the moment
	// the activity concluded or is expected to conclude.
	EndTime time.Time `jsonld:"endTime,omitempty"`
	// Generator identifies the entity (e.g. an application) that generated the object.
	Generator Item `jsonld:"generator,omitempty"`
	// Icon indicates an entity that describes an icon for this object.
	// The image should have an aspect ratio of one (horizontal) to one (vertical)
	// and should be suitable for presentation at a small size.
	Icon Item `jsonld:"icon,omitempty"`
	// Image indicates an entity that describes an image for this object.
	// Unlike the icon property, there are no aspect ratio or display size limitations assumed.
	Image Item `jsonld:"image,omitempty"`
	// InReplyTo indicates one or more entities for which this object is considered a response.
	InReplyTo Item `jsonld:"inReplyTo,omitempty"`
	// Location indicates one or more physical or logical locations associated with the object.
	Location Item `jsonld:"location,omitempty"`
	// Preview identifies an entity that provides a preview of this object.
	Preview Item `jsonld:"preview,omitempty"`
	// Published the date and time at which the object was published
	Published time.Time `jsonld:"published,omitempty"`
	// Replies identifies a Collection containing objects considered to be responses to this object.
	Replies Item `jsonld:"replies,omitempty"`
	// StartTime the date and time describing the actual or expected starting time of the object.
	// When used with an Activity object, for instance, the startTime property specifies
	// the moment the activity began or is scheduled to begin.
	StartTime time.Time `jsonld:"startTime,omitempty"`
	// Summary a natural language summarization of the object encoded as HTML.
	// *Multiple language tagged summaries may be provided.)
	Summary NaturalLanguageValues `jsonld:"summary,omitempty,collapsible"`
	// Tag one or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub Object.
	// The key difference between attachment and tag is that the former implies association by inclusion,
	// while the latter implies associated by reference.
	Tag ItemCollection `jsonld:"tag,omitempty"`
	// Updated the date and time at which the object was updated
	Updated time.Time `jsonld:"updated,omitempty"`
	// URL identifies one or more links to representations of the object
	URL Item `jsonld:"url,omitempty"`
	// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
	To ItemCollection `jsonld:"to,omitempty"`
	// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.
	Bto ItemCollection `jsonld:"bto,omitempty"`
	// CC identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object.
	CC ItemCollection `jsonld:"cc,omitempty"`
	// BCC identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object.
	BCC ItemCollection `jsonld:"bcc,omitempty"`
	// Duration when the object describes a time-bound resource, such as an audio or video, a meeting, etc,
	// the duration property indicates the object's approximate duration.
	// The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
	// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").
	Duration time.Duration `jsonld:"duration,omitempty"`
	// This is a list of all Like activities with this object as the object property, added as a side effect.
	// The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Likes Item `jsonld:"likes,omitempty"`
	// This is a list of all Announce activities with this object as the object property, added as a side effect.
	// The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
	// of an authenticated user or as appropriate when no authentication is given.
	Shares Item `jsonld:"shares,omitempty"`
	// Source property is intended to convey some sort of source from which the content markup was derived,
	// as a form of provenance, or to support future editing by clients.
	// In general, clients do the conversion from source to content, not the other way around.
	Source Source `jsonld:"source,omitempty"`
	// FormerType On a Tombstone object, the formerType property identifies the type of the object that was deleted.
	FormerType ActivityVocabularyType `jsonld:"formerType,omitempty"`
	// Deleted On a Tombstone object, the deleted property is a timestamp for when the object was deleted.
	Deleted time.Time `jsonld:"deleted,omitempty"`
}

Tombstone a Tombstone represents a content object that has been deleted. It can be used in Collections to signify that there used to be an object at this position, but it has been deleted.

func ToTombstone

func ToTombstone(it Item) (*Tombstone, error)

ToTombstone

func (*Tombstone) Clean

func (t *Tombstone) Clean()

Clean removes Bto and BCC properties

func (Tombstone) Format

func (t Tombstone) Format(s fmt.State, verb rune)

func (Tombstone) GetID

func (t Tombstone) GetID() ID

GetID returns the ID corresponding to the current Tombstone

func (t Tombstone) GetLink() IRI

GetLink returns the IRI corresponding to the current Tombstone object

func (Tombstone) GetType

func (t Tombstone) GetType() ActivityVocabularyType

GetType returns the type of the current Tombstone

func (*Tombstone) GobDecode

func (t *Tombstone) GobDecode(data []byte) error

GobDecode

func (Tombstone) GobEncode

func (t Tombstone) GobEncode() ([]byte, error)

GobEncode

func (Tombstone) IsCollection

func (t Tombstone) IsCollection() bool

IsCollection returns false for Tombstone objects

func (t Tombstone) IsLink() bool

IsLink returns false for Tombstone objects

func (Tombstone) IsObject

func (t Tombstone) IsObject() bool

IsObject returns true for Tombstone objects

func (Tombstone) MarshalBinary

func (t Tombstone) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Tombstone) MarshalJSON

func (t Tombstone) MarshalJSON() ([]byte, error)

MarshalJSON encodes the receiver object to a JSON document.

func (*Tombstone) Recipients

func (t *Tombstone) Recipients() ItemCollection

Recipients performs recipient de-duplication on the Tombstone object's To, Bto, CC and BCC properties

func (*Tombstone) UnmarshalBinary

func (t *Tombstone) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Tombstone) UnmarshalJSON

func (t *Tombstone) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an incoming JSON document into the receiver object.

type Travel

type Travel = IntransitiveActivity

Travel indicates that the actor is traveling to target from origin. Travel is an IntransitiveObject whose actor specifies the direct object. If the target or origin are not specified, either can be determined by context.

func TravelNew

func TravelNew(id ID) *Travel

TravelNew initializes a Travel activity

type TyperFn

type TyperFn func(ActivityVocabularyType) (Item, error)

TyperFn is the type of the function which returns an Item struct instance for a specific ActivityVocabularyType

var ItemTyperFunc TyperFn = GetItemByType

ItemTyperFunc will return an instance of a struct that implements activitystreams.Item The default for this package is GetItemByType but can be overwritten

type Undo

type Undo = Activity

Undo indicates that the actor is undoing the object. In most cases, the object will be an Activity describing some previously performed action (for instance, a person may have previously "liked" an article but, for whatever reason, might choose to undo that like at some later point in time). The target and origin typically have no defined meaning.

func UndoNew

func UndoNew(id ID, ob Item) *Undo

UndoNew initializes an Undo activity

type Update

type Update = Activity

Update indicates that the actor has updated the object. Note, however, that this vocabulary does not define a mechanism for describing the actual set of modifications made to object. The target and origin typically have no defined meaning.

func UpdateNew

func UpdateNew(id ID, ob Item) *Update

UpdateNew initializes an Update activity

type ValidationErrors

type ValidationErrors interface {
	error
	Errors() []error
	Add(error)
}

ValidationErrors is an aggregated error interface that allows a Validator implementation to return all possible errors.

type Validator

type Validator interface {
	Validate(receiver IRI, incoming Item) (bool, ValidationErrors)
}

Validator is the interface that needs to be implemented by objects that provide a validation mechanism for incoming ActivityPub Objects or IRIs against an external set of rules.

type Video

type Video = Document

Video represents a video document of any kind

type View

type View = Activity

View indicates that the actor has viewed the object.

func ViewNew

func ViewNew(id ID, ob Item) *View

ViewNew initializes a View activity

type WithActivityFn

type WithActivityFn func(*Activity) error

WithActivityFn represents a function type that can be used as a parameter for OnActivity helper function

type WithActorFn

type WithActorFn func(*Actor) error

WithActorFn represents a function type that can be used as a parameter for OnActor helper function

type WithCollectionFn

type WithCollectionFn func(*Collection) error

WithCollectionFn represents a function type that can be used as a parameter for OnCollection helper function

type WithCollectionInterfaceFn

type WithCollectionInterfaceFn func(CollectionInterface) error

WithCollectionInterfaceFn represents a function type that can be used as a parameter for OnCollectionIntf helper function

type WithCollectionPageFn

type WithCollectionPageFn func(*CollectionPage) error

WithCollectionPageFn represents a function type that can be used as a parameter for OnCollectionPage helper function

type WithIntransitiveActivityFn

type WithIntransitiveActivityFn func(*IntransitiveActivity) error

WithIntransitiveActivityFn represents a function type that can be used as a parameter for OnIntransitiveActivity helper function

type WithItemCollectionFn

type WithItemCollectionFn func(*ItemCollection) error

WithItemCollectionFn represents a function type that can be used as a parameter for OnItemCollection helper function

type WithLinkFn

type WithLinkFn func(*Link) error

WithLinkFn represents a function type that can be used as a parameter for OnLink helper function

type WithObjectFn

type WithObjectFn func(*Object) error

WithObjectFn represents a function type that can be used as a parameter for OnObject helper function

type WithOrderedCollectionFn

type WithOrderedCollectionFn func(*OrderedCollection) error

WithOrderedCollectionFn represents a function type that can be used as a parameter for OnOrderedCollection helper function

type WithOrderedCollectionPageFn

type WithOrderedCollectionPageFn func(*OrderedCollectionPage) error

WithOrderedCollectionPageFn represents a function type that can be used as a parameter for OnOrderedCollectionPage helper function

type WithQuestionFn

type WithQuestionFn func(*Question) error

WithQuestionFn represents a function type that can be used as a parameter for OnQuestion helper function

Jump to

Keyboard shortcuts

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