Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorInvalidType[T Objects | Links](received Item) error
- func GobEncode(it Item) ([]byte, error)
- func IsIRI(it Item) bool
- func IsItemCollection(it Item) bool
- func IsLink(it Item) bool
- func IsNil(it Item) bool
- func IsObject(it Item) bool
- func ItemOrderTimestamp(i1, i2 Item) bool
- func ItemsEqual(it, with Item) bool
- func JSONGetBoolean(val *fastjson.Value, prop string) bool
- func JSONGetBytes(val *fastjson.Value, prop string) []byte
- func JSONGetDuration(val *fastjson.Value, prop string) time.Duration
- func JSONGetFloat(val *fastjson.Value, prop string) float64
- func JSONGetInt(val *fastjson.Value, prop string) int64
- func JSONGetString(val *fastjson.Value, prop string) string
- func JSONGetTime(val *fastjson.Value, prop string) time.Time
- func JSONLoadActivity(val *fastjson.Value, a *Activity) error
- func JSONLoadActor(val *fastjson.Value, a *Actor) error
- func JSONLoadCollection(val *fastjson.Value, c *Collection) error
- func JSONLoadCollectionPage(val *fastjson.Value, c *CollectionPage) error
- func JSONLoadIntransitiveActivity(val *fastjson.Value, i *IntransitiveActivity) error
- func JSONLoadLink(val *fastjson.Value, l *Link) error
- func JSONLoadObject(val *fastjson.Value, o *Object) error
- func JSONLoadOrderedCollection(val *fastjson.Value, c *OrderedCollection) error
- func JSONLoadOrderedCollectionPage(val *fastjson.Value, c *OrderedCollectionPage) error
- func JSONLoadPlace(val *fastjson.Value, p *Place) error
- func JSONLoadProfile(val *fastjson.Value, p *Profile) error
- func JSONLoadPublicKey(val *fastjson.Value, p *PublicKey) error
- func JSONLoadQuestion(val *fastjson.Value, q *Question) error
- func JSONLoadRelationship(val *fastjson.Value, r *Relationship) error
- func JSONLoadTombstone(val *fastjson.Value, t *Tombstone) error
- func JSONWrite(b *[]byte, c ...byte)
- func JSONWriteActivityJSONValue(b *[]byte, a Activity) (notEmpty bool)
- func JSONWriteBoolJSONProp(b *[]byte, n string, t bool) (notEmpty bool)
- func JSONWriteComma(b *[]byte)
- func JSONWriteDurationJSONProp(b *[]byte, n string, d time.Duration) (notEmpty bool)
- func JSONWriteFloatJSONProp(b *[]byte, n string, f float64) (notEmpty bool)
- func JSONWriteIRIJSONProp(b *[]byte, n string, i LinkOrIRI) (notEmpty bool)
- func JSONWriteIntJSONProp(b *[]byte, n string, d int64) (notEmpty bool)
- func JSONWriteIntransitiveActivityJSONValue(b *[]byte, i IntransitiveActivity) (notEmpty bool)
- func JSONWriteItemCollectionJSONProp(b *[]byte, n string, col ItemCollection) (notEmpty bool)
- func JSONWriteItemCollectionJSONValue(b *[]byte, col ItemCollection) (notEmpty bool)
- func JSONWriteItemJSONProp(b *[]byte, n string, i Item) (notEmpty bool)
- func JSONWriteJSONProp(b *[]byte, name string, val []byte) (notEmpty bool)
- func JSONWriteJSONValue(b *[]byte, s []byte) (notEmpty bool)
- func JSONWriteLinkJSONValue(b *[]byte, l Link) (notEmpty bool)
- func JSONWriteNaturalLanguageJSONProp(b *[]byte, n string, nl NaturalLanguageValues) (notEmpty bool)
- func JSONWriteObjectJSONValue(b *[]byte, o Object) (notEmpty bool)
- func JSONWritePropJSONName(b *[]byte, s string) (notEmpty bool)
- func JSONWriteQuestionJSONValue(b *[]byte, q Question) (notEmpty bool)
- func JSONWriteS(b *[]byte, s string)
- func JSONWriteStringJSONProp(b *[]byte, n string, s string) (notEmpty bool)
- func JSONWriteStringJSONValue(b *[]byte, s string) (notEmpty bool)
- func JSONWriteTimeJSONProp(b *[]byte, n string, t time.Time) (notEmpty bool)
- func MarshalJSON(it Item) ([]byte, error)
- func NotEmpty(i Item) bool
- func On[T Item](it Item, fn func(*T) error) error
- func OnActivity(it Item, fn WithActivityFn) error
- func OnActor(it Item, fn WithActorFn) error
- func OnCollection(it Item, fn WithCollectionFn) error
- func OnCollectionIntf(it Item, fn WithCollectionInterfaceFn) error
- func OnCollectionPage(it Item, fn WithCollectionPageFn) error
- func OnIntransitiveActivity(it Item, fn WithIntransitiveActivityFn) error
- func OnItemCollection(it Item, fn WithItemCollectionFn) error
- func OnLink(it LinkOrIRI, fn WithLinkFn) error
- func OnObject(it Item, fn WithObjectFn) error
- func OnOrderedCollection(it Item, fn WithOrderedCollectionFn) error
- func OnOrderedCollectionPage(it Item, fn WithOrderedCollectionPageFn) error
- func OnPlace(it Item, fn withPlaceFn) error
- func OnProfile(it Item, fn withProfileFn) error
- func OnQuestion(it Item, fn WithQuestionFn) error
- func OnRelationship(it Item, fn withRelationshipFn) error
- func OnTombstone(it Item, fn withTombstoneFn) error
- func Split(i IRI) (IRI, CollectionPath)
- func To[T Item](it Item) (*T, error)
- func ValidActivityCollection(typ CollectionPath) bool
- func ValidCollection(typ CollectionPath) bool
- func ValidCollectionIRI(i IRI) bool
- func ValidObjectCollection(typ CollectionPath) bool
- type Accept
- type Activities
- type Activity
- func (a *Activity) Clean()
- func (a Activity) Equals(with Item) bool
- func (a Activity) Format(s fmt.State, verb rune)
- func (a Activity) GetID() ID
- func (a Activity) GetLink() IRI
- func (a Activity) GetType() ActivityVocabularyType
- func (a *Activity) GobDecode(data []byte) error
- func (a Activity) GobEncode() ([]byte, error)
- func (a Activity) IsCollection() bool
- func (a Activity) IsLink() bool
- func (a Activity) IsObject() bool
- func (a Activity) MarshalBinary() ([]byte, error)
- func (a Activity) MarshalJSON() ([]byte, error)
- func (a *Activity) Recipients() ItemCollection
- func (a *Activity) UnmarshalBinary(data []byte) error
- func (a *Activity) UnmarshalJSON(data []byte) error
- type ActivityObject
- type ActivityVocabularyType
- func (a *ActivityVocabularyType) GobDecode(data []byte) error
- func (a ActivityVocabularyType) GobEncode() ([]byte, error)
- func (a ActivityVocabularyType) MarshalBinary() ([]byte, error)
- func (a ActivityVocabularyType) MarshalJSON() ([]byte, error)
- func (a *ActivityVocabularyType) UnmarshalBinary(data []byte) error
- type ActivityVocabularyTypes
- type Actor
- func (a *Actor) Clean()
- func (a Actor) Equals(with Item) bool
- func (a Actor) Format(s fmt.State, verb rune)
- func (a Actor) GetID() ID
- func (a Actor) GetLink() IRI
- func (a Actor) GetType() ActivityVocabularyType
- func (a *Actor) GobDecode(data []byte) error
- func (a Actor) GobEncode() ([]byte, error)
- func (a Actor) IsCollection() bool
- func (a Actor) IsLink() bool
- func (a Actor) IsObject() bool
- func (a Actor) MarshalBinary() ([]byte, error)
- func (a Actor) MarshalJSON() ([]byte, error)
- func (a *Actor) Recipients() ItemCollection
- func (a *Actor) UnmarshalBinary(data []byte) error
- func (a *Actor) UnmarshalJSON(data []byte) error
- type Actors
- type Add
- type Announce
- type Application
- type Arrive
- type Article
- type Audio
- type Block
- type CanReceiveActivities
- type Collection
- func (c *Collection) Append(ob Item) error
- func (c Collection) Collection() ItemCollection
- func (c Collection) Contains(r Item) bool
- func (c *Collection) Count() uint
- func (c Collection) Equals(with Item) bool
- func (c Collection) Format(s fmt.State, verb rune)
- func (c Collection) GetID() ID
- func (c Collection) GetLink() IRI
- func (c Collection) GetType() ActivityVocabularyType
- func (c *Collection) GobDecode(data []byte) error
- func (c Collection) GobEncode() ([]byte, error)
- func (c Collection) IsCollection() bool
- func (c Collection) IsLink() bool
- func (c Collection) IsObject() bool
- func (c Collection) ItemsMatch(col ...Item) bool
- func (c Collection) MarshalBinary() ([]byte, error)
- func (c Collection) MarshalJSON() ([]byte, error)
- func (c *Collection) UnmarshalBinary(data []byte) error
- func (c *Collection) UnmarshalJSON(data []byte) error
- type CollectionInterface
- type CollectionPage
- func (c *CollectionPage) Append(ob Item) error
- func (c CollectionPage) Collection() ItemCollection
- func (c CollectionPage) Contains(r Item) bool
- func (c *CollectionPage) Count() uint
- func (c CollectionPage) Equals(with Item) bool
- func (c CollectionPage) Format(s fmt.State, verb rune)
- func (c CollectionPage) GetID() ID
- func (c CollectionPage) GetLink() IRI
- func (c CollectionPage) GetType() ActivityVocabularyType
- func (c *CollectionPage) GobDecode(data []byte) error
- func (c CollectionPage) GobEncode() ([]byte, error)
- func (c CollectionPage) IsCollection() bool
- func (c CollectionPage) IsLink() bool
- func (c CollectionPage) IsObject() bool
- func (c CollectionPage) ItemsMatch(col ...Item) bool
- func (c CollectionPage) MarshalBinary() ([]byte, error)
- func (c CollectionPage) MarshalJSON() ([]byte, error)
- func (c *CollectionPage) UnmarshalBinary(data []byte) error
- func (c *CollectionPage) UnmarshalJSON(data []byte) error
- type CollectionPath
- type CollectionPaths
- type Collections
- type Content
- func (c Content) Equals(other Content) bool
- func (c Content) Format(s fmt.State, verb rune)
- func (c *Content) GobDecode(data []byte) error
- func (c Content) GobEncode() ([]byte, error)
- func (c Content) String() string
- func (c *Content) UnmarshalJSON(data []byte) error
- func (c *Content) UnmarshalText(data []byte) error
- type Create
- type Delete
- type Dislike
- type Document
- type Endpoints
- type Event
- type Flag
- type Follow
- type FollowersCollection
- type FollowingCollection
- type Group
- type HasRecipients
- type ID
- type IRI
- func (i IRI) AddPath(el ...string) IRI
- func (i IRI) Contains(what IRI, checkScheme bool) bool
- func (i IRI) Equals(with IRI, checkScheme bool) bool
- func (i IRI) Format(s fmt.State, verb rune)
- func (i IRI) GetID() ID
- func (i IRI) GetLink() IRI
- func (i IRI) GetType() ActivityVocabularyType
- func (i *IRI) GobDecode(data []byte) error
- func (i IRI) GobEncode() ([]byte, error)
- func (i IRI) IsCollection() bool
- func (i IRI) IsLink() bool
- func (i IRI) IsObject() bool
- func (i IRI) ItemsMatch(col ...Item) bool
- func (i IRI) MarshalBinary() ([]byte, error)
- func (i IRI) MarshalJSON() ([]byte, error)
- func (i IRI) String() string
- func (i IRI) URL() (*url.URL, error)
- func (i *IRI) UnmarshalBinary(data []byte) error
- func (i *IRI) UnmarshalJSON(s []byte) error
- type IRIs
- func (i *IRIs) Append(r IRI) error
- func (i *IRIs) Collection() ItemCollection
- func (i IRIs) Contains(r IRI) bool
- func (i *IRIs) Count() uint
- func (i IRIs) GetID() ID
- func (i IRIs) GetLink() IRI
- func (i IRIs) GetType() ActivityVocabularyType
- func (i *IRIs) GobDecode(data []byte) error
- func (i IRIs) GobEncode() ([]byte, error)
- func (i IRIs) IsCollection() bool
- func (i IRIs) IsLink() bool
- func (i IRIs) IsObject() bool
- func (i IRIs) MarshalJSON() ([]byte, error)
- func (i *IRIs) UnmarshalJSON(data []byte) error
- type Ignore
- type Image
- type InboxStream
- type IntransitiveActivities
- type IntransitiveActivity
- func (i *IntransitiveActivity) Clean()
- func (i IntransitiveActivity) Equals(with Item) bool
- func (i IntransitiveActivity) Format(s fmt.State, verb rune)
- func (i IntransitiveActivity) GetID() ID
- func (i IntransitiveActivity) GetLink() IRI
- func (i IntransitiveActivity) GetType() ActivityVocabularyType
- func (i *IntransitiveActivity) GobDecode(data []byte) error
- func (i IntransitiveActivity) GobEncode() ([]byte, error)
- func (i IntransitiveActivity) IsCollection() bool
- func (i IntransitiveActivity) IsLink() bool
- func (i IntransitiveActivity) IsObject() bool
- func (i IntransitiveActivity) MarshalBinary() ([]byte, error)
- func (i IntransitiveActivity) MarshalJSON() ([]byte, error)
- func (i *IntransitiveActivity) Recipients() ItemCollection
- func (i *IntransitiveActivity) UnmarshalBinary(data []byte) error
- func (i *IntransitiveActivity) UnmarshalJSON(data []byte) error
- type Invite
- type Item
- func CopyItemProperties(to, from Item) (Item, error)
- func Flatten(it Item) Item
- func FlattenProperties(it Item) Item
- func FlattenToIRI(it Item) Item
- func GetItemByType(typ ActivityVocabularyType) (Item, error)
- func GobDecode(data []byte) (Item, error)
- func JSONGetItem(val *fastjson.Value, prop string) Item
- func JSONGetURIItem(val *fastjson.Value, prop string) Item
- func JSONItemsFn(val *fastjson.Value) (Item, error)
- func JSONLoadItem(val *fastjson.Value) (Item, error)
- func JSONUnmarshalToItem(val *fastjson.Value) Item
- func UnmarshalJSON(data []byte) (Item, error)
- type ItemCollection
- func (i *ItemCollection) Append(o Item) error
- func (i *ItemCollection) Collection() ItemCollection
- func (i ItemCollection) Contains(r Item) bool
- func (i *ItemCollection) Count() uint
- func (i ItemCollection) Equals(with Item) bool
- func (i ItemCollection) First() Item
- func (i ItemCollection) GetID() ID
- func (i ItemCollection) GetLink() IRI
- func (i ItemCollection) GetType() ActivityVocabularyType
- func (i ItemCollection) IsCollection() bool
- func (i ItemCollection) IsLink() bool
- func (i ItemCollection) IsObject() bool
- func (i ItemCollection) ItemsMatch(col ...Item) bool
- func (i ItemCollection) MarshalJSON() ([]byte, error)
- func (i ItemCollection) Normalize() Item
- func (i *ItemCollection) Remove(r Item)
- type JSONUnmarshalerFn
- type Join
- type LangRef
- type LangRefValue
- func (l LangRefValue) Equals(other LangRefValue) bool
- func (l LangRefValue) Format(s fmt.State, verb rune)
- func (l *LangRefValue) GobDecode(data []byte) error
- func (l LangRefValue) GobEncode() ([]byte, error)
- func (l LangRefValue) MarshalJSON() ([]byte, error)
- func (l LangRefValue) MarshalText() ([]byte, error)
- func (l LangRefValue) String() string
- func (l *LangRefValue) UnmarshalJSON(data []byte) error
- func (l *LangRefValue) UnmarshalText(data []byte) error
- type Leave
- type Like
- type LikedCollection
- type LikesCollection
- type Link
- func (l Link) Format(s fmt.State, verb rune)
- func (l Link) GetID() ID
- func (l Link) GetLink() IRI
- func (l Link) GetType() ActivityVocabularyType
- func (l *Link) GobDecode(data []byte) error
- func (l Link) GobEncode() ([]byte, error)
- func (l Link) IsCollection() bool
- func (l Link) IsLink() bool
- func (l Link) IsObject() bool
- func (l Link) MarshalBinary() ([]byte, error)
- func (l Link) MarshalJSON() ([]byte, error)
- func (l *Link) UnmarshalBinary(data []byte) error
- func (l *Link) UnmarshalJSON(data []byte) error
- type LinkOrIRI
- type Links
- type Listen
- type Mapper
- type Mention
- type MimeType
- type Move
- type NaturalLanguageValues
- func (n *NaturalLanguageValues) Add(ref LangRefValue)
- func (n *NaturalLanguageValues) Append(lang LangRef, value Content) error
- func (n *NaturalLanguageValues) Count() uint
- func (n NaturalLanguageValues) Equals(with NaturalLanguageValues) bool
- func (n NaturalLanguageValues) First() LangRefValue
- func (n NaturalLanguageValues) Format(s fmt.State, verb rune)
- func (n NaturalLanguageValues) Get(ref LangRef) Content
- func (n *NaturalLanguageValues) GobDecode(data []byte) error
- func (n NaturalLanguageValues) GobEncode() ([]byte, error)
- func (n NaturalLanguageValues) MarshalJSON() ([]byte, error)
- func (n NaturalLanguageValues) MarshalText() ([]byte, error)
- func (n *NaturalLanguageValues) Set(ref LangRef, v Content) error
- func (n NaturalLanguageValues) String() string
- func (n *NaturalLanguageValues) UnmarshalJSON(data []byte) error
- func (n *NaturalLanguageValues) UnmarshalText(data []byte) error
- type NotEmptyCheckerFn
- type Note
- type Object
- func (o *Object) Clean()
- func (o Object) Equals(with Item) bool
- func (o Object) Format(s fmt.State, verb rune)
- func (o Object) GetID() ID
- func (o Object) GetLink() IRI
- func (o Object) GetType() ActivityVocabularyType
- func (o *Object) GobDecode(data []byte) error
- func (o Object) GobEncode() ([]byte, error)
- func (o Object) IsCollection() bool
- func (o Object) IsLink() bool
- func (o Object) IsObject() bool
- func (o Object) MarshalBinary() ([]byte, error)
- func (o Object) MarshalJSON() ([]byte, error)
- func (o *Object) Recipients() ItemCollection
- func (o *Object) UnmarshalBinary(data []byte) error
- func (o *Object) UnmarshalJSON(data []byte) error
- type ObjectOrLink
- type Objects
- type Offer
- type OrderedCollection
- func (o *OrderedCollection) Append(ob Item) error
- func (o OrderedCollection) Collection() ItemCollection
- func (o OrderedCollection) Contains(r Item) bool
- func (o *OrderedCollection) Count() uint
- func (o OrderedCollection) Equals(with Item) bool
- func (o OrderedCollection) Format(s fmt.State, verb rune)
- func (o OrderedCollection) GetID() ID
- func (o OrderedCollection) GetLink() IRI
- func (o OrderedCollection) GetType() ActivityVocabularyType
- func (o *OrderedCollection) GobDecode(data []byte) error
- func (o OrderedCollection) GobEncode() ([]byte, error)
- func (o OrderedCollection) IsCollection() bool
- func (o OrderedCollection) IsLink() bool
- func (o OrderedCollection) IsObject() bool
- func (o OrderedCollection) ItemsMatch(col ...Item) bool
- func (o OrderedCollection) MarshalBinary() ([]byte, error)
- func (o OrderedCollection) MarshalJSON() ([]byte, error)
- func (o *OrderedCollection) UnmarshalBinary(data []byte) error
- func (o *OrderedCollection) UnmarshalJSON(data []byte) error
- type OrderedCollectionPage
- func (o *OrderedCollectionPage) Append(ob Item) error
- func (o OrderedCollectionPage) Collection() ItemCollection
- func (o OrderedCollectionPage) Contains(r Item) bool
- func (o *OrderedCollectionPage) Count() uint
- func (o OrderedCollectionPage) Equals(with Item) bool
- func (o OrderedCollectionPage) Format(s fmt.State, verb rune)
- func (o OrderedCollectionPage) GetID() ID
- func (o OrderedCollectionPage) GetLink() IRI
- func (o OrderedCollectionPage) GetType() ActivityVocabularyType
- func (o *OrderedCollectionPage) GobDecode(data []byte) error
- func (o OrderedCollectionPage) GobEncode() ([]byte, error)
- func (o OrderedCollectionPage) IsCollection() bool
- func (o OrderedCollectionPage) IsLink() bool
- func (o OrderedCollectionPage) IsObject() bool
- func (o OrderedCollectionPage) ItemsMatch(col ...Item) bool
- func (o OrderedCollectionPage) MarshalBinary() ([]byte, error)
- func (o OrderedCollectionPage) MarshalJSON() ([]byte, error)
- func (o *OrderedCollectionPage) UnmarshalBinary(data []byte) error
- func (o *OrderedCollectionPage) UnmarshalJSON(data []byte) error
- type Organization
- type OutboxStream
- type Page
- type Person
- type Place
- func (p *Place) Clean()
- func (p Place) Format(s fmt.State, verb rune)
- func (p Place) GetID() ID
- func (p Place) GetLink() IRI
- func (p Place) GetType() ActivityVocabularyType
- func (p *Place) GobDecode(data []byte) error
- func (p Place) GobEncode() ([]byte, error)
- func (p Place) IsCollection() bool
- func (p Place) IsLink() bool
- func (p Place) IsObject() bool
- func (p Place) MarshalBinary() ([]byte, error)
- func (p Place) MarshalJSON() ([]byte, error)
- func (p *Place) Recipients() ItemCollection
- func (p *Place) UnmarshalBinary(data []byte) error
- func (p *Place) UnmarshalJSON(data []byte) error
- type Profile
- func (p *Profile) Clean()
- func (p Profile) Format(s fmt.State, verb rune)
- func (p Profile) GetID() ID
- func (p Profile) GetLink() IRI
- func (p Profile) GetType() ActivityVocabularyType
- func (p *Profile) GobDecode(data []byte) error
- func (p Profile) GobEncode() ([]byte, error)
- func (p Profile) IsCollection() bool
- func (p Profile) IsLink() bool
- func (p Profile) IsObject() bool
- func (p Profile) MarshalBinary() ([]byte, error)
- func (p Profile) MarshalJSON() ([]byte, error)
- func (p *Profile) Recipients() ItemCollection
- func (p *Profile) UnmarshalBinary(data []byte) error
- func (p *Profile) UnmarshalJSON(data []byte) error
- type PublicKey
- type Question
- func (q Question) Format(s fmt.State, verb rune)
- func (q Question) GetID() ID
- func (q Question) GetLink() IRI
- func (q Question) GetType() ActivityVocabularyType
- func (q *Question) GobDecode(data []byte) error
- func (q Question) GobEncode() ([]byte, error)
- func (q Question) IsCollection() bool
- func (q Question) IsLink() bool
- func (q Question) IsObject() bool
- func (q Question) MarshalBinary() ([]byte, error)
- func (q Question) MarshalJSON() ([]byte, error)
- func (q *Question) UnmarshalBinary(data []byte) error
- func (q *Question) UnmarshalJSON(data []byte) error
- type Read
- type Reject
- type Relationship
- func (r *Relationship) Clean()
- func (r Relationship) Format(s fmt.State, verb rune)
- func (r Relationship) GetID() ID
- func (r Relationship) GetLink() IRI
- func (r Relationship) GetType() ActivityVocabularyType
- func (r *Relationship) GobDecode(data []byte) error
- func (r Relationship) GobEncode() ([]byte, error)
- func (r Relationship) IsCollection() bool
- func (r Relationship) IsLink() bool
- func (r Relationship) IsObject() bool
- func (r Relationship) MarshalBinary() ([]byte, error)
- func (r Relationship) MarshalJSON() ([]byte, error)
- func (r *Relationship) Recipients() ItemCollection
- func (r *Relationship) UnmarshalBinary(data []byte) error
- func (r *Relationship) UnmarshalJSON(data []byte) error
- type Remove
- type Service
- type SharesCollection
- type Source
- type TentativeAccept
- type TentativeReject
- type Tombstone
- func (t *Tombstone) Clean()
- func (t Tombstone) Format(s fmt.State, verb rune)
- func (t Tombstone) GetID() ID
- func (t Tombstone) GetLink() IRI
- func (t Tombstone) GetType() ActivityVocabularyType
- func (t *Tombstone) GobDecode(data []byte) error
- func (t Tombstone) GobEncode() ([]byte, error)
- func (t Tombstone) IsCollection() bool
- func (t Tombstone) IsLink() bool
- func (t Tombstone) IsObject() bool
- func (t Tombstone) MarshalBinary() ([]byte, error)
- func (t Tombstone) MarshalJSON() ([]byte, error)
- func (t *Tombstone) Recipients() ItemCollection
- func (t *Tombstone) UnmarshalBinary(data []byte) error
- func (t *Tombstone) UnmarshalJSON(data []byte) error
- type Travel
- type TyperFn
- type Undo
- type Update
- type ValidationErrors
- type Validator
- type Video
- type View
- type WithActivityFn
- type WithActorFn
- type WithCollectionFn
- type WithCollectionInterfaceFn
- type WithCollectionPageFn
- type WithIntransitiveActivityFn
- type WithItemCollectionFn
- type WithLinkFn
- type WithObjectFn
- type WithOrderedCollectionFn
- type WithOrderedCollectionPageFn
- type WithQuestionFn
Constants ¶
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" )
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 )
const ( Unknown = CollectionPath("") Outbox = CollectionPath("outbox") Inbox = CollectionPath("inbox") Replies = CollectionPath("replies") // activitystreams Following = CollectionPath("following") Followers = CollectionPath("followers") Liked = CollectionPath("liked") Likes = CollectionPath("likes") )
Variables ¶
var ( OfObject = CollectionPaths{ Likes, Shares, Replies, } OfActor = CollectionPaths{ Outbox, Inbox, Liked, Following, Followers, } ActivityPubCollections = CollectionPaths{ Outbox, Inbox, Liked, Following, Followers, Likes, Shares, Replies, } )
var ActivityTypes = ActivityVocabularyTypes{ AcceptType, AddType, AnnounceType, BlockType, CreateType, DeleteType, DislikeType, FlagType, FollowType, IgnoreType, InviteType, JoinType, LeaveType, LikeType, ListenType, MoveType, OfferType, RejectType, ReadType, RemoveType, TentativeRejectType, TentativeAcceptType, UndoType, UpdateType, ViewType, }
var ActorTypes = ActivityVocabularyTypes{ ApplicationType, GroupType, OrganizationType, PersonType, ServiceType, }
ActorTypes represent the valid Actor types.
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.
var CollectionTypes = ActivityVocabularyTypes{ CollectionOfItems, CollectionType, OrderedCollectionType, CollectionPageType, OrderedCollectionPageType, }
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".
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".
var DefaultLang = NilLangRef
DefaultLang represents the default language reference used when using the convenience content generation.
var EventRSVPActivityTypes = ActivityVocabularyTypes{ AcceptType, IgnoreType, InviteType, RejectType, TentativeAcceptType, TentativeRejectType, }
EventRSVPActivityTypes use case primarily deals with invitations to events and RSVP type responses.
https://www.w3.org/TR/activitystreams-vocabulary/#motivations-rsvp
var GenericTypes = ActivityVocabularyTypes{ ActivityType, IntransitiveActivityType, ObjectType, ActorType, }
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".
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.
var IntransitiveActivityTypes = ActivityVocabularyTypes{ ArriveType, TravelType, QuestionType, }
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.
var LinkTypes = ActivityVocabularyTypes{ LinkType, MentionType, }
LinkTypes represent the valid values for a Link object
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
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
var ObjectTypes = ActivityVocabularyTypes{ ArticleType, AudioType, DocumentType, EventType, ImageType, NoteType, PageType, PlaceType, ProfileType, RelationshipType, TombstoneType, VideoType, }
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.
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
var ReactionsActivityTypes = ActivityVocabularyTypes{ AcceptType, BlockType, DislikeType, FlagType, IgnoreType, LikeType, RejectType, TentativeAcceptType, TentativeRejectType, }
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.
var RelationshipManagementActivityTypes = ActivityVocabularyTypes{ AcceptType, AddType, BlockType, CreateType, DeleteType, FollowType, IgnoreType, InviteType, RejectType, }
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
var Types = ActivityVocabularyTypes{ LinkType, MentionType, ArticleType, AudioType, DocumentType, EventType, ImageType, NoteType, PageType, PlaceType, ProfileType, RelationshipType, TombstoneType, VideoType, QuestionType, CollectionType, OrderedCollectionType, CollectionPageType, OrderedCollectionPageType, ApplicationType, GroupType, OrganizationType, PersonType, ServiceType, AcceptType, AddType, AnnounceType, BlockType, CreateType, DeleteType, DislikeType, FlagType, FollowType, IgnoreType, InviteType, JoinType, LeaveType, LikeType, ListenType, MoveType, OfferType, RejectType, ReadType, RemoveType, TentativeRejectType, TentativeAcceptType, UndoType, UpdateType, ViewType, ArriveType, TravelType, QuestionType, }
Types contains all valid types in the ActivityPub vocabulary
Functions ¶
func IsItemCollection ¶
IsItemCollection returns if the current Item interface holds a Collection
func ItemOrderTimestamp ¶
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 ¶
ItemsEqual checks if it and with Items are equal
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 JSONLoadOrderedCollection ¶
func JSONLoadOrderedCollection(val *fastjson.Value, c *OrderedCollection) error
func JSONLoadOrderedCollectionPage ¶
func JSONLoadOrderedCollectionPage(val *fastjson.Value, c *OrderedCollectionPage) error
func JSONLoadRelationship ¶
func JSONLoadRelationship(val *fastjson.Value, r *Relationship) error
func JSONWriteBoolJSONProp ¶
func JSONWriteComma ¶
func JSONWriteComma(b *[]byte)
func JSONWriteFloatJSONProp ¶
func JSONWriteIRIJSONProp ¶
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 JSONWriteJSONValue ¶
func JSONWriteLinkJSONValue ¶
func JSONWriteNaturalLanguageJSONProp ¶
func JSONWriteNaturalLanguageJSONProp(b *[]byte, n string, nl NaturalLanguageValues) (notEmpty bool)
func JSONWritePropJSONName ¶
func JSONWriteS ¶
func JSONWriteStringJSONProp ¶
func JSONWriteTimeJSONProp ¶
func MarshalJSON ¶
MarshalJSON represents just a wrapper for the jsonld.Marshal function
func NotEmpty ¶
NotEmpty tells us if a Item interface value has a non nil value for various types that implement
func On ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 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 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.
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"` // 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 ¶
FlattenActivityProperties flattens the Activity's properties from Object type to IRI
func (Activity) GetType ¶
func (a Activity) GetType() ActivityVocabularyType
GetType returns the ActivityVocabulary type of the current Activity
func (Activity) IsCollection ¶
IsCollection returns false for Activity objects
func (Activity) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Activity) MarshalJSON ¶
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 ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Activity) UnmarshalJSON ¶
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 ¶
func (a ActivityVocabularyTypes) Contains(typ ActivityVocabularyType) bool
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"` // 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 ¶
FlattenActorProperties flattens the Actor's properties from Object types to IRI
func UpdatePersonProperties ¶
UpdatePersonProperties
func (Actor) GetType ¶
func (a Actor) GetType() ActivityVocabularyType
GetType returns the type of the current Actor
func (Actor) IsCollection ¶
IsCollection returns false for Actor Objects
func (Actor) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Actor) MarshalJSON ¶
func (*Actor) Recipients ¶
func (a *Actor) Recipients() ItemCollection
func (*Actor) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Actor) UnmarshalJSON ¶
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.
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 ¶
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.
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.
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"` // 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 (*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) GetID ¶
func (c Collection) GetID() ID
GetID returns the ID corresponding to the Collection object
func (Collection) GetLink ¶
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 (Collection) IsLink ¶
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) 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"` // 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 (*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) GetID ¶
func (c CollectionPage) GetID() ID
GetID returns the ID corresponding to the CollectionPage object
func (CollectionPage) GetLink ¶
func (c CollectionPage) GetLink() IRI
GetLink returns the IRI corresponding to the CollectionPage object
func (CollectionPage) GetType ¶
func (c CollectionPage) GetType() ActivityVocabularyType
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 (CollectionPage) IsLink ¶
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) 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.
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 Collections ¶
type Collections interface { Collection | CollectionPage | OrderedCollection | OrderedCollectionPage | ItemCollection }
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.
type Dislike ¶
type Dislike = Activity
Dislike indicates that the actor dislikes the object.
func DislikeNew ¶
DislikeNew initializes a Dislike activity
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 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 (Endpoints) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*Endpoints) UnmarshalJSON ¶
UnmarshalJSON decodes an incoming JSON document into the receiver object.
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.
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.
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 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)
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 (IRI) Equals ¶
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) IsCollection ¶
IsCollection returns false for IRI objects
func (IRI) ItemsMatch ¶
func (IRI) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (IRI) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*IRI) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*IRI) UnmarshalJSON ¶
UnmarshalJSON decodes an incoming JSON document into the receiver object.
type IRIs ¶
type IRIs []IRI
func (*IRIs) Append ¶
Append facilitates adding elements to IRI slices and ensures IRIs implements the Collection interface
func (*IRIs) Collection ¶
func (i *IRIs) Collection() ItemCollection
func (IRIs) GetType ¶
func (i IRIs) GetType() ActivityVocabularyType
GetType returns the ItemCollection's type
func (IRIs) IsCollection ¶
IsCollection returns true for IRI slices
func (IRIs) MarshalJSON ¶
func (*IRIs) UnmarshalJSON ¶
type Ignore ¶
type Ignore = Activity
Ignore indicates that the actor is ignoring the object. The target and origin typically have no defined meaning.
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"` // 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) GetID ¶
func (i IntransitiveActivity) GetID() ID
GetID returns the ID corresponding to the IntransitiveActivity object
func (IntransitiveActivity) GetLink ¶
func (i IntransitiveActivity) GetLink() IRI
GetLink returns the IRI corresponding to the IntransitiveActivity object
func (IntransitiveActivity) GetType ¶
func (i IntransitiveActivity) GetType() ActivityVocabularyType
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 (IntransitiveActivity) IsLink ¶
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.
type Item ¶
type Item = ObjectOrLink
Item struct
func CopyItemProperties ¶
CopyItemProperties delegates to the correct per type functions for copying properties between matching Activity Objects
func Flatten ¶
Flatten checks if Item can be flattened to an IRI or array of IRIs and returns it if so
func FlattenProperties ¶
FlattenProperties flattens the Item's properties from Object types to IRI
func FlattenToIRI ¶
FlattenToIRI checks if Item can be flatten to an IRI and returns it if so
func GetItemByType ¶
func GetItemByType(typ ActivityVocabularyType) (Item, error)
func JSONUnmarshalToItem ¶
func UnmarshalJSON ¶
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 (*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) 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 (ItemCollection) GetType ¶
func (i ItemCollection) GetType() ActivityVocabularyType
GetType returns the ItemCollection's type
func (ItemCollection) IsCollection ¶
func (i ItemCollection) IsCollection() bool
IsCollection returns true for ItemCollection arrays
func (ItemCollection) IsLink ¶
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) 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.
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 (*LangRef) UnmarshalJSON ¶
UnmarshalJSON decodes an incoming JSON document into the receiver object.
func (*LangRef) UnmarshalText ¶
UnmarshalText implements the TextEncoder interface
type LangRefValue ¶
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) 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.
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.
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 ¶
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 (Link) GetType ¶
func (l Link) GetType() ActivityVocabularyType
GetType returns the Type corresponding to the Mention object
func (Link) IsCollection ¶
IsCollection returns false for Link objects
func (Link) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Link) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*Link) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Link) UnmarshalJSON ¶
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 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 MimeType ¶
type MimeType string
MimeType is the type for representing MIME types in certain ActivityStreams properties
func (MimeType) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (MimeType) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*MimeType) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*MimeType) UnmarshalJSON ¶
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.
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 ¶
func (n NaturalLanguageValues) Equals(with NaturalLanguageValues) bool
Equals
func (NaturalLanguageValues) First ¶
func (n NaturalLanguageValues) First() LangRefValue
First returns the first element in the array
func (NaturalLanguageValues) Get ¶
func (n NaturalLanguageValues) Get(ref LangRef) Content
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 ¶
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"` // 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 ¶
CopyObjectProperties updates the "old" object properties with "new's"
func FlattenObjectProperties ¶
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 ¶
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) GetType ¶
func (o Object) GetType() ActivityVocabularyType
GetType returns the type of the current Object
func (Object) IsCollection ¶
IsCollection returns false for Object objects
func (Object) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Object) MarshalJSON ¶
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 ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Object) UnmarshalJSON ¶
UnmarshalJSON decodes an incoming JSON document into the receiver object.
type ObjectOrLink ¶
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 Objects ¶
type Objects interface { Object | Tombstone | Place | Profile | Relationship | Actors | Activities | IntransitiveActivities | Collections | IRI }
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.
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"` // 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) GetID ¶
func (o OrderedCollection) GetID() ID
GetID returns the ID corresponding to the OrderedCollection
func (OrderedCollection) GetLink ¶
func (o OrderedCollection) GetLink() IRI
GetLink returns the IRI corresponding to the OrderedCollection object
func (OrderedCollection) GetType ¶
func (o OrderedCollection) GetType() ActivityVocabularyType
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 (OrderedCollection) IsLink ¶
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"` // 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) GetID ¶
func (o OrderedCollectionPage) GetID() ID
GetID returns the ID corresponding to the OrderedCollectionPage object
func (OrderedCollectionPage) GetLink ¶
func (o OrderedCollectionPage) GetLink() IRI
GetLink returns the IRI corresponding to the OrderedCollectionPage object
func (OrderedCollectionPage) GetType ¶
func (o OrderedCollectionPage) GetType() ActivityVocabularyType
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 (OrderedCollectionPage) IsLink ¶
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 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"` // 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 (Place) GetType ¶
func (p Place) GetType() ActivityVocabularyType
GetType returns the type of the current Place
func (Place) IsCollection ¶
IsCollection returns false for Place objects
func (Place) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Place) MarshalJSON ¶
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 ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Place) UnmarshalJSON ¶
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"` // 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 (Profile) GetType ¶
func (p Profile) GetType() ActivityVocabularyType
GetType returns the type of the current Profile
func (Profile) IsCollection ¶
IsCollection returns false for Profile objects
func (Profile) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Profile) MarshalJSON ¶
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 ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Profile) UnmarshalJSON ¶
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 (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
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"` // 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 ToQuestion ¶
ToQuestion tries to convert the it Item to a Question object.
func (Question) GetType ¶
func (q Question) GetType() ActivityVocabularyType
GetType returns the ActivityVocabulary type of the current Activity
func (Question) IsCollection ¶
IsCollection returns false for Question objects
func (Question) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Question) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*Question) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Question) UnmarshalJSON ¶
UnmarshalJSON decodes an incoming JSON document into the receiver object.
type Reject ¶
type Reject = Activity
Reject indicates that the actor is rejecting the object. The target and origin typically have no defined meaning.
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"` // 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) GetID ¶
func (r Relationship) GetID() ID
GetID returns the ID corresponding to the current Relationship
func (Relationship) GetLink ¶
func (r Relationship) GetLink() IRI
GetLink returns the IRI corresponding to the current Relationship object
func (Relationship) GetType ¶
func (r Relationship) GetType() ActivityVocabularyType
GetType returns the type of the current Relationship
func (Relationship) IsCollection ¶
func (r Relationship) IsCollection() bool
IsCollection returns false for Relationship objects
func (Relationship) IsLink ¶
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.
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 (Source) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Source) MarshalJSON ¶
MarshalJSON encodes the receiver object to a JSON document.
func (*Source) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Source) UnmarshalJSON ¶
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"` // 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 (Tombstone) GetType ¶
func (t Tombstone) GetType() ActivityVocabularyType
GetType returns the type of the current Tombstone
func (Tombstone) IsCollection ¶
IsCollection returns false for Tombstone objects
func (Tombstone) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Tombstone) MarshalJSON ¶
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 ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Tombstone) UnmarshalJSON ¶
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.
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.
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.
type ValidationErrors ¶
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 WithActivityFn ¶
WithActivityFn represents a function type that can be used as a parameter for OnActivity helper function
type WithActorFn ¶
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 ¶
WithLinkFn represents a function type that can be used as a parameter for OnLink helper function
type WithObjectFn ¶
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 ¶
WithQuestionFn represents a function type that can be used as a parameter for OnQuestion helper function
Source Files ¶
- activity.go
- actor.go
- collection.go
- collection_page.go
- copy.go
- decoding_gob.go
- decoding_json.go
- encoding_gob.go
- encoding_json.go
- flatten.go
- helpers.go
- intransitive_activity.go
- iri.go
- item.go
- item_collection.go
- link.go
- natural_language_values.go
- object.go
- object_id.go
- ordered_collection.go
- ordered_collection_page.go
- place.go
- profile.go
- question.go
- relationship.go
- tombstone.go
- typer.go
- types.go
- validation.go