Changes
10 changed files (+113/-110)
-
-
@@ -68,15 +68,15 @@ var validActivityTypes = [...]ActivityVocabularyType{// Actor Types } // Activity is a subtype of GetID that describes some form of action that may happen, // 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. type Activity struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Object 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.
-
@@ -90,7 +90,7 @@ type Activity struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The 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.)
-
@@ -130,7 +130,7 @@ type Activity struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -138,13 +138,13 @@ type Activity struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -152,7 +152,7 @@ type Activity struct {// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S"). Duration time.Duration `jsonld:"duration,omitempty"` // 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 GetLink. // Any single activity can have multiple actors. The actor may be specified using an indirect Link. Actor Actor `jsonld:"actor,omitempty"` // 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
-
@@ -180,9 +180,9 @@ type Activity struct {// IntransitiveActivity Instances of IntransitiveActivity are a subtype of Activity representing intransitive actions. // The object property is therefore inappropriate for these activities. type IntransitiveActivity struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Object 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.
-
@@ -196,7 +196,7 @@ type IntransitiveActivity struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The 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.)
-
@@ -236,7 +236,7 @@ type IntransitiveActivity struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -244,13 +244,13 @@ type IntransitiveActivity struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -258,7 +258,7 @@ type IntransitiveActivity struct {// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S"). Duration time.Duration `jsonld:"duration,omitempty"` // 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 GetLink. // Any single activity can have multiple actors. The actor may be specified using an indirect Link. Actor Actor `jsonld:"actor,omitempty"` // 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
-
@@ -391,9 +391,9 @@ type (// Either of the anyOf and oneOf properties may be used to express possible answers, // but a Question object must not have both properties. type Question struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Object 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.
-
@@ -407,7 +407,7 @@ type Question struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The 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.)
-
@@ -447,7 +447,7 @@ type Question struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -455,13 +455,13 @@ type Question struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -469,7 +469,7 @@ type Question struct {// section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S"). Duration time.Duration `jsonld:"duration,omitempty"` // 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 GetLink. // Any single activity can have multiple actors. The actor may be specified using an indirect Link. Actor Actor `jsonld:"actor,omitempty"` // 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
-
@@ -763,6 +763,7 @@ func (i *IntransitiveActivity) GetType() ActivityVocabularyType {func (i *IntransitiveActivity) IsLink() bool { return false } // GetID returns the ObjectID corresponding to the IntransitiveActivity object func (i *IntransitiveActivity) GetID() ObjectID { return i.ID }
-
-
-
@@ -48,12 +48,12 @@ type Endpoints struct {// 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 GetID in ActivityPub. // Actors are retrieved like any other Object in ActivityPub. // Like other ActivityStreams objects, actors have an id, which is a URI. type Actor struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Object 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.
-
@@ -67,7 +67,7 @@ type Actor struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The 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.)
-
@@ -107,7 +107,7 @@ type Actor struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -115,13 +115,13 @@ type Actor struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -251,7 +251,7 @@ func (a Actor) IsObject() bool {return a.Type == ObjectType || ValidObjectType(a.Type) } // GetID returns the GetID corresponding to the Actor object // GetID returns the ObjectID corresponding to the Actor object func (a Actor) GetID() ObjectID { return a.ID }
-
@@ -271,7 +271,7 @@ func (a Application) IsObject() bool {return a.Type == ObjectType || ValidObjectType(a.Type) } // GetID returns the GetID corresponding to the Application object // GetID returns the ObjectID corresponding to the Application object func (a Application) GetID() ObjectID { return a.ID }
-
@@ -291,7 +291,7 @@ func (a Group) IsObject() bool {return a.Type == ObjectType || ValidObjectType(a.Type) } // GetID returns the GetID corresponding to the Group object // GetID returns the ObjectID corresponding to the Group object func (a Group) GetID() ObjectID { return a.ID }
-
@@ -311,7 +311,7 @@ func (a Organization) IsObject() bool {return a.Type == ObjectType || ValidObjectType(a.Type) } // GetID returns the GetID corresponding to the Organization object // GetID returns the ObjectID corresponding to the Organization object func (a Organization) GetID() ObjectID { return a.ID }
-
@@ -331,7 +331,7 @@ func (a Service) IsObject() bool {return a.Type == ObjectType || ValidObjectType(a.Type) } // GetID returns the GetID corresponding to the Service object // GetID returns the ObjectID corresponding to the Service object func (a Service) GetID() ObjectID { return a.ID }
-
@@ -351,7 +351,7 @@ func (p Person) IsObject() bool {return p.Type == ObjectType || ValidObjectType(p.Type) } // GetID returns the GetID corresponding to the Person object // GetID returns the ObjectID corresponding to the Person object func (p Person) GetID() ObjectID { return p.ID }
-
@@ -361,7 +361,7 @@ func (p Person) GetType() ActivityVocabularyType {return p.Type } // GetLink returns the URI for the current Person object // Link returns the URI for the current Person object func (p Person) GetLink() URI { return p.URL.(URI) }
-
-
-
@@ -103,7 +103,7 @@ func TestValidActorType(t *testing.T) {func TestActor_IsLink(t *testing.T) { m := ActorNew("test", ActorType) if m.IsLink() { t.Errorf("%#v should not be a valid GetLink", m.Type) t.Errorf("%#v should not be a valid Link", m.Type) } }
-
@@ -124,14 +124,14 @@ func TestActor_Object(t *testing.T) {func TestActor_Type(t *testing.T) { m := ActorNew("test", ActorType) if m.GetType() != ActorType { t.Errorf("%#v should be an empty GetLink object", m.GetType()) t.Errorf("%#v should be an empty Link object", m.GetType()) } } func TestPerson_IsLink(t *testing.T) { m := PersonNew("test") if m.IsLink() { t.Errorf("%T should not be a valid GetLink", m) t.Errorf("%T should not be a valid Link", m) } }
-
-
-
@@ -11,11 +11,11 @@ type CollectionInterface interface {Append(ob ObjectOrLink) error } // Collection is a subtype of GetID that represents ordered or unordered sets of GetID or GetLink instances. // Collection is a subtype of Activity Pub Object that represents ordered or unordered sets of Activity Pub Object or Link instances. type Collection struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Activity Pub Object 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.
-
@@ -29,7 +29,7 @@ type Collection struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The content or textual representation of the Activity Pub 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.)
-
@@ -69,7 +69,7 @@ type Collection struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -77,13 +77,13 @@ type Collection struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -100,9 +100,9 @@ type Collection struct {// OrderedCollection is a subtype of Collection in which members of the logical // collection are assumed to always be strictly ordered. type OrderedCollection struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for an Activity Pub Activity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Activity Pub Object 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.
-
@@ -116,7 +116,7 @@ type OrderedCollection struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The content or textual representation of the Activity Pub 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.)
-
@@ -156,7 +156,7 @@ type OrderedCollection struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -164,13 +164,13 @@ type OrderedCollection struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies an Activity Pub Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies an Activity Pub Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -284,7 +284,7 @@ func (c *Collection) IsLink() bool {return false } // GetID returns the Collection's object ID // GetID returns the ObjectID corresponding to the Collection object func (c *Collection) GetID() ObjectID { return c.ID }
-
@@ -304,7 +304,7 @@ func (o *OrderedCollection) IsLink() bool {return false } // GetID returns the OrderedCollection's object ID // GetID returns the ObjectID corresponding to the OrderedCollection func (o *OrderedCollection) GetID() ObjectID { return o.ID }
-
-
-
@@ -40,7 +40,7 @@ func (o *Inbox) Append(ob ObjectOrLink) error {return nil } // GetID returns the InboxStream's object ID // GetID returns the ObjectID corresponding to InboxStream func (i InboxStream) GetID() ObjectID { return i.ID }
-
-
-
@@ -39,7 +39,7 @@ func (l *Liked) Append(ob ObjectOrLink) error {return nil } // GetID returns the LikedCollection's object ID // GetID returns the ObjectID corresponding to the LikedCollection func (l LikedCollection) GetID() ObjectID { return l.ID }
-
-
-
@@ -4,41 +4,41 @@ var validLinkTypes = [...]ActivityVocabularyType{MentionType, } // A GetLink is an indirect, qualified reference to a resource identified by a URL. // 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 GetLink. // When a GetLink is used, it establishes a qualified relation connecting the subject // 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 GetLink are properties of the reference as opposed to properties of the resource. // Properties of the Link are properties of the reference as opposed to properties of the resource. type Link struct { // Provides the globally unique identifier for an APObject or GetLink. // Provides the globally unique identifier for an APObject or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the APObject or GetLink type. Multiple values may be specified. // 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 NaturalLanguageValue `jsonld:"name,omitempty,collapsible"` // A link relation associated with a GetLink. The value must conform to both the [HTML5] and // 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 *Link `jsonld:"rel,omitempty"` // When used on a Link, identifies the MIME media type of the referenced resource. MediaType MimeType `jsonld:"mediaType,omitempty"` // On a GetLink, specifies a hint as to the rendering height in device-independent pixels of the linked resource. // 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 GetLink, specifies a hint as to the rendering width in device-independent pixels of the linked resource. // 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 ObjectOrLink `jsonld:"preview,omitempty"` // The target resource pointed to by a GetLink. // The target resource pointed to by a Link. Href URI `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"` } // Mention is a specialized GetLink that represents an @mention. // Mention is a specialized Link that represents an @mention. type Mention Link // ValidLinkType validates a type against the valid link types
-
@@ -51,7 +51,7 @@ func ValidLinkType(typ ActivityVocabularyType) bool {return false } // LinkNew initializes a new GetLink // LinkNew initializes a new Link func LinkNew(id ObjectID, typ ActivityVocabularyType) *Link { if !ValidLinkType(typ) { typ = LinkType
-
@@ -64,27 +64,27 @@ func MentionNew(id ObjectID) *Mention {return &Mention{ID: id, Type: MentionType} } // IsLink validates if current GetLink is a GetLink // IsLink validates if current Link is a Link func (l Link) IsLink() bool { return l.Type == LinkType || ValidLinkType(l.Type) } // IsObject validates if current GetLink is an GetID // IsObject validates if current Link is an GetID func (l Link) IsObject() bool { return l.Type == ObjectType || ValidObjectType(l.Type) } // GetID returns the GetID corresponding to the Mention object // GetID returns the ObjectID corresponding to the Mention object func (l Link) GetID() ObjectID { return l.ID } // GetLink returns the GetLink corresponding to the Mention object // GetType returns the Type corresponding to the Mention object func (l Link) GetType() ActivityVocabularyType { return l.Type } // IsLink validates if current Mention is a GetLink // IsLink validates if current Mention is a Link func (m Mention) IsLink() bool { return m.Type == MentionType || ValidLinkType(m.Type) }
-
@@ -94,12 +94,12 @@ func (m Mention) IsObject() bool {return m.Type == ObjectType || ValidObjectType(m.Type) } // GetID returns the GetID corresponding to the Mention object // GetID returns the ObjectID corresponding to the Mention object func (m Mention) GetID() ObjectID { return m.ID } // GetLink returns the GetLink corresponding to the Mention object // GetType returns the Type corresponding to the Mention object func (m Mention) GetType() ActivityVocabularyType { return m.Type }
-
-
-
@@ -23,14 +23,14 @@ func TestValidLinkType(t *testing.T) {var invalidType ActivityVocabularyType = "RandomType" if ValidLinkType(LinkType) { t.Errorf("Generic GetLink Type '%v' should not be valid", LinkType) t.Errorf("Generic Link Type '%v' should not be valid", LinkType) } if ValidLinkType(invalidType) { t.Errorf("GetLink Type '%v' should not be valid", invalidType) t.Errorf("Link Type '%v' should not be valid", invalidType) } for _, validType := range validLinkTypes { if !ValidLinkType(validType) { t.Errorf("GetLink Type '%v' should be valid", validType) t.Errorf("Link Type '%v' should be valid", validType) } } }
-
@@ -76,4 +76,4 @@ func TestMention_Object(t *testing.T) {if !reflect.DeepEqual(ObjectID("test"), m.GetID()) { t.Errorf("%#v should be an empty object", m.GetID()) } } }
-
-
-
@@ -33,7 +33,7 @@ const (CollectionType ActivityVocabularyType = "Collection" OrderedCollectionType ActivityVocabularyType = "OrderedCollection" // Activity Pub GetID Types // Activity Pub Object Types ArticleType ActivityVocabularyType = "Article" AudioType ActivityVocabularyType = "Audio" DocumentType ActivityVocabularyType = "Document"
-
@@ -84,7 +84,7 @@ var validObjectTypes = [...]ActivityVocabularyType{type ( // ActivityVocabularyType is the data type for an Activity type object ActivityVocabularyType string // ActivityObject is a subtype of GetID that describes some form of action that may happen, // ActivityObject is a subtype of Object that describes some form of action that may happen, // is currently happening, or has already happened ActivityObject interface{} // ObjectOrLink describes an object of any kind.
-
@@ -92,16 +92,18 @@ type (ActivityObject GetID() ObjectID GetType() ActivityVocabularyType //IsLink() bool //IsObject() bool //UnmarshalJSON([]byte) error } // ObjectsArr is a named type for matching an ObjectOrLink slice type to Collection interface ObjectsArr []ObjectOrLink // LinkOrURI is an interface that GetID and GetLink structs implement, and at the same time // LinkOrURI is an interface that Object and Link structs implement, and at the same time // they are kept disjointed LinkOrURI interface { GetLink() URI } // ImageOrLink is an interface that Image and GetLink structs implement // ImageOrLink is an interface that Image and Link structs implement ImageOrLink interface{} // MimeType is the type for MIME types MimeType string
-
@@ -111,12 +113,12 @@ type (NaturalLanguageValue map[LangRef]string ) // IsLink validates if current Activity Pub GetID is a GetLink // IsLink validates if currentActivity Pub Object is a Link func (o Object) IsLink() bool { return false } // IsObject validates if current Activity Pub GetID is an GetID // IsObject validates if currentActivity Pub Object is an Object func (o Object) IsObject() bool { return true }
-
@@ -178,12 +180,12 @@ func (n *NaturalLanguageValue) UnmarshalJSON(data []byte) error {} // Describes an object of any kind. // The Activity Pub GetID type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, // 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. type Object struct { // Provides the globally unique identifier for an Activity Pub GetID or GetLink. // Provides the globally unique identifier for anActivity Pub Object or Link. ID ObjectID `jsonld:"id,omitempty"` // Identifies the Activity Pub GetID or GetLink type. Multiple values may be specified. // Identifies the Activity Pub Object 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.
-
@@ -197,7 +199,7 @@ type Object struct {// Identifies one or more entities that represent the total population of entities // for which the object can considered to be relevant. Audience ObjectOrLink `jsonld:"audience,omitempty"` // The content or textual representation of the Activity Pub GetID encoded as a JSON string. // The 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.)
-
@@ -240,7 +242,7 @@ type Object struct {// A natural language summarization of the object encoded as HTML. // *Multiple language tagged summaries may be provided.) Summary NaturalLanguageValue `jsonld:"summary,omitempty,collapsible"` // One or more "tags" that have been associated with an objects. A tag can be any kind of Activity Pub GetID. // 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 ObjectOrLink `jsonld:"tag,omitempty"`
-
@@ -248,13 +250,13 @@ type Object struct {Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object URL LinkOrURI `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub GetID // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectsArr `jsonld:"to,omitempty"` // Identifies an Activity Pub GetID that is part of the private primary audience of this Activity Pub GetID. // Identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectsArr `jsonld:"bto,omitempty"` // Identifies an Activity Pub GetID that is part of the public secondary audience of this Activity Pub GetID. // Identifies anActivity Pub Object that is part of the public secondary audience of this Activity Pub Object. CC ObjectsArr `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub GetID. // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. BCC ObjectsArr `jsonld:"bcc,omitempty"` // 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.
-
@@ -293,7 +295,7 @@ func ValidObjectType(typ ActivityVocabularyType) bool {return ValidActivityType(typ) || ValidActorType(typ) || ValidCollectionType(typ) || ValidGenericType(typ) } // ObjectNew initializes a new GetID // ObjectNew initializes a new Object func ObjectNew(id ObjectID, typ ActivityVocabularyType) *Object { if !(ValidObjectType(typ)) { typ = ObjectType
-
@@ -305,12 +307,12 @@ func ObjectNew(id ObjectID, typ ActivityVocabularyType) *Object {return &o } // GetID returns the GetID corresponding to the GetID object // GetID returns the ObjectID corresponding to the current object func (o Object) GetID() ObjectID { return o.ID } // GetLink returns the GetLink corresponding to the GetID object // Link returns the Link corresponding to the current object func (o Object) GetType() ActivityVocabularyType { return o.Type }
-
-
-
@@ -38,7 +38,7 @@ func (o *Outbox) Append(ob ObjectOrLink) error {return nil } // GetID returns the OutboxStream's object ID // GetID returns the ObjectID corresponding to the OutboxStream func (o OutboxStream) GetID() ObjectID { return o.ID }
-