Documentation ¶
Index ¶
- Constants
- Variables
- func JSONGetBoolean(data []byte, prop string) bool
- func JSONGetDuration(data []byte, prop string) time.Duration
- func JSONGetFloat(data []byte, prop string) float64
- func JSONGetInt(data []byte, prop string) int64
- func JSONGetString(data []byte, prop string) string
- func JSONGetTime(data []byte, prop string) time.Time
- func ValidLinkType(typ ActivityVocabularyType) bool
- type Accept
- type Activity
- func (a *Activity) Clean()
- func (a Activity) GetID() ObjectID
- func (a Activity) GetLink() IRI
- func (a Activity) GetType() ActivityVocabularyType
- func (a Activity) IsCollection() bool
- func (a Activity) IsLink() bool
- func (a Activity) IsObject() bool
- func (a *Activity) Recipients() ItemCollection
- func (a *Activity) UnmarshalJSON(data []byte) error
- type ActivityObject
- type ActivityVocabularyType
- type ActivityVocabularyTypes
- type Actor
- type Add
- type Announce
- type Application
- type Arrive
- type Article
- type Audio
- type Block
- type Collection
- func (c *Collection) Append(ob Item) error
- func (c Collection) Collection() ItemCollection
- func (c Collection) Contains(r IRI) bool
- func (c *Collection) Count() uint
- func (c Collection) GetID() ObjectID
- func (c Collection) GetLink() IRI
- func (c Collection) GetType() ActivityVocabularyType
- func (c Collection) IsCollection() bool
- func (c Collection) IsLink() bool
- func (c Collection) IsObject() bool
- 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 IRI) bool
- func (c *CollectionPage) Count() uint
- func (c CollectionPage) GetID() ObjectID
- func (c CollectionPage) GetLink() IRI
- func (c CollectionPage) GetType() ActivityVocabularyType
- func (c CollectionPage) IsCollection() bool
- func (c CollectionPage) IsLink() bool
- func (c CollectionPage) IsObject() bool
- func (c *CollectionPage) UnmarshalJSON(data []byte) error
- type Create
- type Delete
- type Dislike
- type Document
- type Event
- type Flag
- type Follow
- type Group
- type HasRecipients
- type IRI
- func (i IRI) Contains(what IRI, checkScheme bool) bool
- func (i IRI) Equals(with IRI, checkScheme bool) bool
- func (i IRI) GetID() ObjectID
- func (i IRI) GetLink() IRI
- func (i IRI) GetType() ActivityVocabularyType
- func (i IRI) IsCollection() bool
- func (i IRI) IsLink() bool
- func (i IRI) IsObject() bool
- func (i IRI) String() string
- func (i IRI) URL() (*url.URL, error)
- func (i *IRI) UnmarshalJSON(s []byte) error
- type IRIs
- type Ignore
- type Image
- type IntransitiveActivity
- func (i *IntransitiveActivity) Clean()
- func (i IntransitiveActivity) GetID() ObjectID
- func (i IntransitiveActivity) GetLink() IRI
- func (i IntransitiveActivity) GetType() ActivityVocabularyType
- func (i IntransitiveActivity) IsCollection() bool
- func (i IntransitiveActivity) IsLink() bool
- func (i IntransitiveActivity) IsObject() bool
- func (i *IntransitiveActivity) Recipients() ItemCollection
- func (i *IntransitiveActivity) UnmarshalJSON(data []byte) error
- type Invite
- type Item
- func Flatten(it Item) Item
- func FlattenProperties(it Item) Item
- func FlattenToIRI(it Item) Item
- func JSONGetItem(data []byte, prop string) Item
- func JSONGetItemByType(typ ActivityVocabularyType) (Item, error)
- func JSONGetURIItem(data []byte, prop string) Item
- func JSONUnmarshalToItem(data []byte) 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 IRI) bool
- func (i *ItemCollection) Count() uint
- func (i ItemCollection) First() Item
- func (i ItemCollection) GetID() ObjectID
- 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
- type Join
- type LangRef
- type LangRefValue
- type Leave
- type Like
- type Link
- type LinkOrIRI
- type Listen
- type Mapper
- type Mention
- type MimeType
- type Move
- type NaturalLanguageValues
- func (n *NaturalLanguageValues) Append(lang LangRef, value string) error
- func (n *NaturalLanguageValues) Count() uint
- func (n NaturalLanguageValues) First() LangRefValue
- func (n NaturalLanguageValues) Get(ref LangRef) string
- func (n NaturalLanguageValues) MarshalJSON() ([]byte, error)
- func (n NaturalLanguageValues) MarshalText() ([]byte, error)
- func (n *NaturalLanguageValues) Set(ref LangRef, v string) error
- func (n NaturalLanguageValues) String() string
- func (n *NaturalLanguageValues) UnmarshalJSON(data []byte) error
- func (n *NaturalLanguageValues) UnmarshalText(data []byte) error
- type Note
- type Object
- func (o *Object) Clean()
- func (o Object) GetID() ObjectID
- func (o Object) GetLink() IRI
- func (o Object) GetType() ActivityVocabularyType
- func (o Object) IsCollection() bool
- func (o Object) IsLink() bool
- func (o Object) IsObject() bool
- func (o *Object) Recipients() ItemCollection
- func (o *Object) UnmarshalJSON(data []byte) error
- type ObjectID
- type ObjectOrLink
- type Offer
- type OrderedCollection
- func (o *OrderedCollection) Append(ob Item) error
- func (o *OrderedCollection) Collection() ItemCollection
- func (o OrderedCollection) Contains(r IRI) bool
- func (o *OrderedCollection) Count() uint
- func (o OrderedCollection) GetID() ObjectID
- func (o OrderedCollection) GetLink() IRI
- func (o OrderedCollection) GetType() ActivityVocabularyType
- func (o OrderedCollection) IsCollection() bool
- func (o OrderedCollection) IsLink() bool
- func (o OrderedCollection) IsObject() bool
- 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 IRI) bool
- func (o *OrderedCollectionPage) Count() uint
- func (o OrderedCollectionPage) GetID() ObjectID
- func (o OrderedCollectionPage) GetLink() IRI
- func (o OrderedCollectionPage) GetType() ActivityVocabularyType
- func (o OrderedCollectionPage) IsCollection() bool
- func (o OrderedCollectionPage) IsLink() bool
- func (o OrderedCollectionPage) IsObject() bool
- func (o *OrderedCollectionPage) UnmarshalJSON(data []byte) error
- type Organization
- type Page
- type Person
- type Place
- func (p *Place) Clean()
- func (p Place) GetID() ObjectID
- func (p Place) GetLink() IRI
- func (p Place) GetType() ActivityVocabularyType
- func (p Place) IsCollection() bool
- func (p Place) IsLink() bool
- func (p Place) IsObject() bool
- func (p *Place) Recipients() ItemCollection
- func (p *Place) UnmarshalJSON(data []byte) error
- type Profile
- func (p *Profile) Clean()
- func (p Profile) GetID() ObjectID
- func (p Profile) GetLink() IRI
- func (p Profile) GetType() ActivityVocabularyType
- func (p Profile) IsCollection() bool
- func (p Profile) IsLink() bool
- func (p Profile) IsObject() bool
- func (p *Profile) Recipients() ItemCollection
- func (p *Profile) UnmarshalJSON(data []byte) error
- type Question
- type Read
- type Reject
- type Relationship
- func (r *Relationship) Clean()
- func (r Relationship) GetID() ObjectID
- func (r Relationship) GetLink() IRI
- func (r Relationship) GetType() ActivityVocabularyType
- func (r Relationship) IsCollection() bool
- func (r Relationship) IsLink() bool
- func (r Relationship) IsObject() bool
- func (r *Relationship) Recipients() ItemCollection
- func (r *Relationship) UnmarshalJSON(data []byte) error
- type Remove
- type Service
- type TentativeAccept
- type TentativeReject
- type Tombstone
- func (t *Tombstone) Clean()
- func (t Tombstone) GetID() ObjectID
- func (t Tombstone) GetLink() IRI
- func (t Tombstone) GetType() ActivityVocabularyType
- func (t Tombstone) IsCollection() bool
- func (t Tombstone) IsLink() bool
- func (t Tombstone) IsObject() bool
- func (t *Tombstone) Recipients() ItemCollection
- func (t *Tombstone) UnmarshalJSON(data []byte) error
- type Travel
- type TyperFn
- type Undo
- type Update
- type Video
- type View
Constants ¶
const EmptyIRI = IRI("")
const EmptyObjectID = ObjectID("")
const PublicNS = IRI("https://www.w3.org/ns/activitystreams#Public")
Variables ¶
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, }
var CollectionManagementActivityTypes = ActivityVocabularyTypes{ AddType, MoveType, RemoveType, }
CollectionManagementActivityTypes use case primarily deals with activities involving the management of content within collections. 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. 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. This includes, for instance, activities such as "John created a new note", "Sally updated an article", and "Joe deleted the photo".
var EventRSVPActivityTypes = ActivityVocabularyTypes{ AcceptType, IgnoreType, InviteType, RejectType, TentativeAcceptType, TentativeRejectType, }
EventRSVPActivityTypes use case primarily deals with invitations to events and RSVP type responses.
var GenericLinkTypes = ActivityVocabularyTypes{ LinkType, }
var GenericObjectTypes = ActivityVocabularyTypes{ ActivityType, IntransitiveActivityType, ObjectType, ActorType, CollectionType, OrderedCollectionType, }
var GenericTypes = append(GenericObjectTypes[:], GenericLinkTypes[:]...)
var GeoSocialEventsActivityTypes = ActivityVocabularyTypes{ ArriveType, LeaveType, TravelType, }
GeoSocialEventsActivityTypes use case primarily deals with activities involving geo-tagging type activities. 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. 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 NegatingActivityTypes = ActivityVocabularyTypes{ UndoType, }
NegatingActivityTypes use case primarily deals with the ability to redact previously completed activities. See 5.5 Inverse Activities and "Undo" for more information.
var NotificationActivityTypes = ActivityVocabularyTypes{ AnnounceType, }
NotificationActivityTypes use case primarily deals with calling attention to particular objects or notifications.
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. 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. See 5.4 Representing Questions for more information.
var ReactionsActivityTypes = ActivityVocabularyTypes{ AcceptType, BlockType, DislikeType, FlagType, IgnoreType, LikeType, RejectType, TentativeAcceptType, TentativeRejectType, }
ReactionsActivityTypes use case primarily deals with reactions to content. 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 (e.g. friend requests, management of social network, etc). See 5.2 Representing Relationships Between Entities for more information.
Functions ¶
func JSONGetBoolean ¶
func JSONGetFloat ¶
func JSONGetInt ¶
func JSONGetString ¶
func ValidLinkType ¶
func ValidLinkType(typ ActivityVocabularyType) bool
ValidLinkType validates a type against the valid link types
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 Activity ¶
type Activity struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // Actor 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 ObjectID, 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) Recipients ¶
func (a *Activity) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Activity's To, Bto, CC and BCC properties
type ActivityObject ¶
type ActivityObject interface { // GetID returns the dereferenceable ActivityStreams object id GetID() ObjectID // 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" )
Actor Types
const ( // ActivityBaseURI the basic URI for the activity streams namespaces ActivityBaseURI = IRI("https://www.w3.org/ns/activitystreams") 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" // Activity Pub 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(data []byte) ActivityVocabularyType
type ActivityVocabularyTypes ¶
type ActivityVocabularyTypes []ActivityVocabularyType
func (ActivityVocabularyTypes) Contains ¶
func (a ActivityVocabularyTypes) Contains(typ ActivityVocabularyType) bool
type Actor ¶
type Actor Item
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.
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 = Object
Application describes a software application.
func ApplicationNew ¶
func ApplicationNew(id ObjectID) *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 Collection ¶
type Collection struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 preceeding 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 ObjectID) *Collection
CollectionNew initializes a new Collection
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 IRI) 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() ObjectID
GetID returns the ObjectID 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) 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) UnmarshalJSON ¶
func (c *Collection) UnmarshalJSON(data []byte) error
UnmarshalJSON
type CollectionInterface ¶
type CollectionInterface interface { ObjectOrLink Collection() ItemCollection Append(ob Item) error Count() uint Contains(IRI) bool }
type CollectionPage ¶
type CollectionPage struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 preceeding 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 (*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 IRI) 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() ObjectID
GetID returns the ObjectID 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) 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) UnmarshalJSON ¶
func (c *CollectionPage) UnmarshalJSON(data []byte) error
UnmarshalJSON
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 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 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 IRI ¶
type IRI string
IRI is a Internationalized Resource Identifiers (IRIs) RFC3987
func JSONGetIRI ¶
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
type Ignore ¶
type Ignore = Activity
Ignore indicates that the actor is ignoring the object. The target and origin typically have no defined meaning.
type IntransitiveActivity ¶
type IntransitiveActivity struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // Actor 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 Actor `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 IntransitiveActivity's properties from Object type to IRI
func IntransitiveActivityNew ¶
func IntransitiveActivityNew(id ObjectID, typ ActivityVocabularyType) *IntransitiveActivity
IntransitiveActivityNew initializes a intransitive activity
func ToIntransitiveActivity ¶
func ToIntransitiveActivity(it Item) (*IntransitiveActivity, error)
ToIntransitiveActivity
func (*IntransitiveActivity) Clean ¶
func (i *IntransitiveActivity) Clean()
Clean removes Bto and BCC properties
func (IntransitiveActivity) GetID ¶
func (i IntransitiveActivity) GetID() ObjectID
GetID returns the ObjectID 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) 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) Recipients ¶
func (i *IntransitiveActivity) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Activity's To, Bto, CC and BCC properties
func (*IntransitiveActivity) UnmarshalJSON ¶
func (i *IntransitiveActivity) UnmarshalJSON(data []byte) error
UnmarshalJSON
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 Flatten ¶
Flatten checks if Item can be flatten 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 JSONGetItem ¶
func JSONGetItemByType ¶
func JSONGetItemByType(typ ActivityVocabularyType) (Item, error)
func JSONGetURIItem ¶
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(c ItemCollection) ItemCollection
FlattenItemCollection flattens the Collection's properties from Object type to IRI
func ItemCollectionDeduplication ¶
func ItemCollectionDeduplication(recCols ...*ItemCollection) (ItemCollection, error)
ItemCollectionDeduplication normalizes the received arguments lists into a single unified one
func JSONGetItems ¶
func JSONGetItems(data []byte, 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 IRI) 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 ObjectID corresponding to ItemCollection
func (ItemCollection) GetID ¶
func (i ItemCollection) GetID() ObjectID
GetID returns the ObjectID 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
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 = "-"
)
func JSONGetLangRefField ¶
func (*LangRef) UnmarshalJSON ¶
UnmarshalJSON implements the JsonEncoder interface
func (*LangRef) UnmarshalText ¶
UnmarshalText implements the TextEncoder interface
type LangRefValue ¶
LangRefValue is a type for storing per language values
func (LangRefValue) MarshalJSON ¶
func (l LangRefValue) MarshalJSON() ([]byte, error)
MarshalJSON serializes the LangRefValue into JSON
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 implements the JsonEncoder interface
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 Link ¶
type Link struct { // Provides the globally unique identifier for an APObject or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the APObject or Link type. Multiple values may be specified. Type ActivityVocabularyType `jsonld:"type,omitempty"` // A simple, human-readable, plain-text name for the object. // HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values. Name NaturalLanguageValues `jsonld:"name,omitempty,collapsible"` // A link relation associated with a Link. The value must conform to both the [HTML5] and // [RFC5988](https://tools.ietf.org/html/rfc5988) "link relation" definitions. // In the [HTML5], any string not containing the "space" U+0020, "tab" (U+0009), "LF" (U+000A), // "FF" (U+000C), "CR" (U+000D) or "," (U+002C) characters can be used as a valid link relation. Rel IRI `jsonld:"rel,omitempty"` // When used on a Link, identifies the MIME media type of the referenced resource. MediaType MimeType `jsonld:"mediaType,omitempty"` // On a Link, specifies a hint as to the rendering height in device-independent pixels of the linked resource. Height uint `jsonld:"height,omitempty"` // On a Link, specifies a hint as to the rendering width in device-independent pixels of the linked resource. Width uint `jsonld:"width,omitempty"` // Identifies an entity that provides a preview of this object. Preview Item `jsonld:"preview,omitempty"` // The target resource pointed to by a Link. Href IRI `jsonld:"href,omitempty"` // Hints as to the language used by the target resource. // Value must be a [BCP47](https://tools.ietf.org/html/bcp47) Language-Tag. HrefLang LangRef `jsonld:"hrefLang,omitempty"` }
A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [ RFC5988]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of APObject or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href. Properties of the Link are properties of the reference as opposed to properties of the resource.
func LinkNew ¶
func LinkNew(id ObjectID, typ ActivityVocabularyType) *Link
LinkNew initializes a new Link
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
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 JSONGetMimeType ¶
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 JSONGetNaturalLanguageField ¶
func JSONGetNaturalLanguageField(data []byte, prop string) NaturalLanguageValues
func NaturalLanguageValuesNew ¶
func NaturalLanguageValuesNew() NaturalLanguageValues
func (*NaturalLanguageValues) Append ¶
func (n *NaturalLanguageValues) Append(lang LangRef, value string) 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) First ¶
func (n NaturalLanguageValues) First() LangRefValue
First returns the first element in the array
func (NaturalLanguageValues) Get ¶
func (n NaturalLanguageValues) Get(ref LangRef) string
func (NaturalLanguageValues) MarshalJSON ¶
func (n NaturalLanguageValues) MarshalJSON() ([]byte, error)
MarshalJSON serializes the NaturalLanguageValues into JSON
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 string) 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 tries to load the NaturalLanguage array from the incoming json value
func (*NaturalLanguageValues) UnmarshalText ¶
func (n *NaturalLanguageValues) UnmarshalText(data []byte) error
UnmarshalText tries to load the NaturalLanguage array from the incoming Text value
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 ObjectID `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 LinkOrIRI `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"` }
Describes an object of any kind. The Activity Pub Object type 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 ActorNew ¶
func ActorNew(id ObjectID, typ ActivityVocabularyType) *Object
ActorNew initializes an Actor type actor
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) Recipients ¶
func (o *Object) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Object's To, Bto, CC and BCC properties
type ObjectID ¶
type ObjectID IRI
ObjectID designates an 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 dereferenceable URIs, such as HTTPS URIs, with their authority belonging to that of their originating server. (Publicly facing content SHOULD use HTTPS URIs). 2. An ID explicitly specified as the JSON null object, which implies an anonymous object (a part of its parent context)
func JSONGetObjectID ¶
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 }
Item describes the requirements of an ActivityStreams object
type Offer ¶
type Offer = Activity
Offer indicates that the actor is offering the object. If specified, the target indicates the entity to which the object is being offered.
type OrderedCollection ¶
type OrderedCollection struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 preceeding 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 OrderedCollectionNew ¶
func OrderedCollectionNew(id ObjectID) *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 OrderedCollection
func (*OrderedCollection) Collection ¶
func (o *OrderedCollection) Collection() ItemCollection
Collection returns the underlying Collection type
func (OrderedCollection) Contains ¶
func (o OrderedCollection) Contains(r IRI) bool
Contains verifies if OrderedCollection array contains the received one
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() ObjectID
GetID returns the ObjectID 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) 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) UnmarshalJSON ¶
func (o *OrderedCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON
type OrderedCollectionPage ¶
type OrderedCollectionPage struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 preceeding 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 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 IRI) 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() ObjectID
GetID returns the ObjectID 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) 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) UnmarshalJSON ¶
func (o *OrderedCollectionPage) UnmarshalJSON(data []byte) error
UnmarshalJSON
type Organization ¶
type Organization = Object
Organization represents an organization.
func OrganizationNew ¶
func OrganizationNew(id ObjectID) *Organization
OrganizationNew initializes an Organization type actor
type Place ¶
type Place struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 // 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 // Latitude the latitude of a place Latitude float64 // Longitude the longitude of a place Longitude float64 // 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 // 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 }
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) Recipients ¶
func (p *Place) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Place object's To, Bto, CC and BCC properties
type Profile ¶
type Profile struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // 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 Actor 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) Recipients ¶
func (p *Profile) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Profile object's To, Bto, CC and BCC properties
type Question ¶
type Question struct { // ID provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `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 LinkOrIRI `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"` // Actor 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 Actor `jsonld:"actor,omitempty"` // Target describes the indirect object, or target, of the activity. // The precise meaning of the target is largely dependent on the type of action being described // but will often be the object of the English preposition "to". // For instance, in the activity "John added a movie to his wishlist", // the target of the activity is John's wishlist. An activity can have more than one target. Target Item `jsonld:"target,omitempty"` // Result describes the result of the activity. For instance, if a particular action results in the creation // of a new resource, the result property can be used to describe that new resource. Result Item `jsonld:"result,omitempty"` // Origin describes an indirect object of the activity from which the activity is directed. // The precise meaning of the origin is the object of the English preposition "from". // For instance, in the activity "John moved an item to List B from List A", the origin of the activity is "List A". Origin Item `jsonld:"origin,omitempty"` // Instrument identifies one or more objects used (or to be used) in the completion of an Activity. Instrument Item `jsonld:"instrument,omitempty"` // OneOf identifies an exclusive option for a Question. Use of oneOf implies that the Question // can have only a single answer. To indicate that a Question can have multiple answers, use anyOf. OneOf Item `jsonld:"oneOf,omitempty"` // AnyOf identifies an inclusive option for a Question. Use of anyOf implies that the Question can have multiple answers. // To indicate that a Question can have only one answer, use oneOf. AnyOf Item `jsonld:"anyOf,omitempty"` // Closed indicates that a question has been closed, and answers are no longer accepted. Closed bool `jsonld:"closed,omitempty"` }
Question represents a question being asked. Question objects are an extension of IntransitiveActivity. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property. Either of the anyOf and oneOf properties may be used to express possible answers, but a Question object must not have both properties.
func QuestionNew ¶
QuestionNew initializes a Question activity
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
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 ObjectID `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 LinkOrIRI `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"` // 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 // Object Object Item // Relationship On a Relationship object, the relationship property identifies the kind // of relationship that exists between subject and object. Relationship Item }
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 (Relationship) GetID ¶
func (r Relationship) GetID() ObjectID
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) Recipients ¶
func (r *Relationship) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Relationship object's To, Bto, CC and BCC properties
func (*Relationship) UnmarshalJSON ¶
func (r *Relationship) UnmarshalJSON(data []byte) error
UnmarshalJSON
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 TentativeAccept ¶
type TentativeAccept = Accept
TentativeAccept is a specialization of Accept indicating that the acceptance is tentative.
func TentativeAcceptNew ¶
func TentativeAcceptNew(id ObjectID, 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 ObjectID, 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 ObjectID `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 LinkOrIRI `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"` // 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) Recipients ¶
func (t *Tombstone) Recipients() ItemCollection
Recipients performs recipient de-duplication on the Tombstone object's To, Bto, CC and BCC properties
func (*Tombstone) UnmarshalJSON ¶
UnmarshalJSON
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 activitystreams.Item struct instance for a specific ActivityVocabularyType
var ItemTyperFunc TyperFn
ItemTyperFunc will return an instance of a struct that implements activitystreams.Item The default for this package is JSONGetItemByType 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.