Changes
5 changed files (+30/-30)
-
-
@@ -67,7 +67,7 @@ var validActivityTypes = [...]ActivityVocabularyType{// IntransitiveActivity Instances of IntransitiveActivity are a subtype of Activity representing intransitive actions. // The object property is therefore inappropriate for these activities. type IntransitiveActivity struct { *APObject *apObject // 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"`
-
@@ -89,7 +89,7 @@ type IntransitiveActivity struct {Source Source `jsonld:"source,omitempty"` } // Activity is a subtype of APObject that describes some form of action that may happen, // Activity is a subtype of apObject 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
-
@@ -439,7 +439,7 @@ func ActivityNew(id ObjectId, _type ActivityVocabularyType, ob ObjectOrLink) *Ac_type = ActivityType } o := ObjectNew(id, _type) i := IntransitiveActivity{APObject: o} i := IntransitiveActivity{apObject: o} a := Activity{IntransitiveActivity: &i} a.Object = ob
-
@@ -454,5 +454,5 @@ func IntransitiveActivityNew(id ObjectId, _type ActivityVocabularyType) *Intrans} o := ObjectNew(id, _type) return &IntransitiveActivity{APObject: o} return &IntransitiveActivity{apObject: o} }
-
-
-
@@ -41,9 +41,9 @@ type Endpoints struct {SharedInbox ObjectOrLink `jsonld:"sharedInbox,omitempty"` } // Actor types are APObject types that are capable of performing activities. // Actor types are apObject types that are capable of performing activities. type Actor struct { *APObject *apObject // A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor; // see 5.2 Inbox. Inbox InboxStream `jsonld:"inbox,omitempty"`
-
@@ -103,7 +103,7 @@ func ActorNew(id ObjectId, _type ActivityVocabularyType) *Actor {_type = ActorType } o := ObjectNew(id, _type) a := Actor{APObject: o} a := Actor{apObject: o} a.PreferredUsername = make(NaturalLanguageValue, 0) return &a }
-
-
-
@@ -7,7 +7,7 @@ type Page ObjectOrLink// Collection type Collection struct { *APObject *apObject // 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,omitempty"`
-
@@ -17,7 +17,7 @@ type Collection struct {// OrderedCollection type OrderedCollection struct { *APObject *apObject // 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,omitempty"`
-
@@ -71,14 +71,14 @@ func ValidCollectionType(_type ActivityVocabularyType) bool {func CollectionNew(id ObjectId) *Collection { o := ObjectNew(id, CollectionType) return &Collection{APObject: o} return &Collection{apObject: o} } // CollectionNew initializes a new Collection func OrderedCollectionNew(id ObjectId) *OrderedCollection { o := ObjectNew(id, OrderedCollectionType) return &OrderedCollection{APObject: o} return &OrderedCollection{apObject: o} } // CollectionNew initializes a new Collection
-
-
-
@@ -35,7 +35,7 @@ func TestCreateActivityNew(t *testing.T) {if now.Sub(c.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if !reflect.DeepEqual(c1.Activity.Object.(*APObject), n) { if !reflect.DeepEqual(c1.Activity.Object.(*apObject), n) { t.Errorf("Object \n'%#v' different than expected \n'%#v'", c1.Activity.Object, n) } }
-
-
-
@@ -11,7 +11,7 @@ type ObjectId stringconst ( // ActivityBaseURI the basic URI for the activity streams namespaces ActivityBaseURI URI = URI("https://www.w3.org/ns/activitystreams#") ObjectType ActivityVocabularyType = "APObject" ObjectType ActivityVocabularyType = "apObject" LinkType ActivityVocabularyType = "Link" ActivityType ActivityVocabularyType = "Activity" IntransitiveActivityType ActivityVocabularyType = "IntransitiveActivity"
-
@@ -19,7 +19,7 @@ const (CollectionType ActivityVocabularyType = "Collection" OrderedCollectionType ActivityVocabularyType = "OrderedCollection" // APObject Types // apObject Types ArticleType ActivityVocabularyType = "Article" AudioType ActivityVocabularyType = "Audio" DocumentType ActivityVocabularyType = "Document"
-
@@ -89,13 +89,13 @@ type (NaturalLanguageValue map[LangRef]string ) // IsLink validates if current APObject is a Link func (o APObject) IsLink() bool { // IsLink validates if current apObject is a Link func (o apObject) IsLink() bool { return ValidLinkType(o.Type) } // IsObject validates if current APObject is an Object func (o APObject) IsObject() bool { // IsObject validates if current apObject is an Object func (o apObject) IsObject() bool { return ValidObjectType(o.Type) }
-
@@ -111,12 +111,12 @@ func (n NaturalLanguageValue) MarshalJSON() ([]byte, error) {} // Describes an object of any kind. // The APObject type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, // The apObject 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 APObject struct { // Provides the globally unique identifier for an APObject or Link. type apObject 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. // 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.
-
@@ -130,7 +130,7 @@ type APObject 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 APObject encoded as a JSON string. // The content or textual representation of the apObject 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.)
-
@@ -170,7 +170,7 @@ type APObject 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 APObject. // One or more "tags" that have been associated with an objects. A tag can be any kind of apObject. // 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"`
-
@@ -178,13 +178,13 @@ type APObject 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 APObject // Identifies an entity considered to be part of the public primary audience of an apObject To ObjectOrLink `jsonld:"to,omitempty"` // Identifies an APObject that is part of the private primary audience of this APObject. // Identifies an apObject that is part of the private primary audience of this apObject. Bto ObjectOrLink `jsonld:"bto,omitempty"` // Identifies an APObject that is part of the public secondary audience of this APObject. // Identifies an apObject that is part of the public secondary audience of this apObject. Cc ObjectOrLink `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this APObject. // Identifies one or more Objects that are part of the private secondary audience of this apObject. Bcc ObjectOrLink `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.
-
@@ -223,11 +223,11 @@ func ValidObjectType(_type ActivityVocabularyType) bool {} // ObjectNew initializes a new Object func ObjectNew(id ObjectId, _type ActivityVocabularyType) *APObject { func ObjectNew(id ObjectId, _type ActivityVocabularyType) *apObject { if !(ValidObjectType(_type)) { _type = ObjectType } o := APObject{Id: id, Type: _type} o := apObject{Id: id, Type: _type} o.Name = make(NaturalLanguageValue) o.Content = make(NaturalLanguageValue) o.Summary = make(NaturalLanguageValue)
-