Changes
11 changed files (+116/-121)
-
-
@@ -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 ObjectOrLink `jsonld:"actor,omitempty"`
-
-
-
@@ -7,8 +7,8 @@ func TestActivityNew(t *testing.T) {var testType ActivityVocabularyType = "Accept" a := ActivityNew(testValue, testType, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != testType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, testType)
-
@@ -16,8 +16,8 @@ func TestActivityNew(t *testing.T) {g := ActivityNew(testValue, "", nil) if g.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", g.Id, testValue) if g.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", g.ID, testValue) } if g.Type != ActivityType { t.Errorf("Activity Type '%v' different than expected '%v'", g.Type, ActivityType)
-
@@ -30,8 +30,8 @@ func TestIntransitiveActivityNew(t *testing.T) {a := IntransitiveActivityNew(testValue, testType) if a.Id != testValue { t.Errorf("IntransitiveActivity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("IntransitiveActivity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != testType { t.Errorf("IntransitiveActivity Type '%v' different than expected '%v'", a.Type, testType)
-
@@ -39,8 +39,8 @@ func TestIntransitiveActivityNew(t *testing.T) {g := IntransitiveActivityNew(testValue, "") if g.Id != testValue { t.Errorf("IntransitiveActivity Id '%v' different than expected '%v'", g.Id, testValue) if g.ID != testValue { t.Errorf("IntransitiveActivity Id '%v' different than expected '%v'", g.ID, testValue) } if g.Type != IntransitiveActivityType { t.Errorf("IntransitiveActivity Type '%v' different than expected '%v'", g.Type, IntransitiveActivityType)
-
@@ -73,8 +73,8 @@ func TestAcceptNew(t *testing.T) {a := AcceptNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != AcceptType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, AcceptType)
-
@@ -86,8 +86,8 @@ func TestAddNew(t *testing.T) {a := AddNew(testValue, nil, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != AddType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, AddType)
-
@@ -99,8 +99,8 @@ func TestAnnounceNew(t *testing.T) {a := AnnounceNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != AnnounceType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, AnnounceType)
-
@@ -112,8 +112,8 @@ func TestArriveNew(t *testing.T) {a := ArriveNew(testValue) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != ArriveType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, ArriveType)
-
@@ -125,8 +125,8 @@ func TestBlockNew(t *testing.T) {a := BlockNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != BlockType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, BlockType)
-
@@ -138,8 +138,8 @@ func TestCreateNew(t *testing.T) {a := CreateNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != CreateType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, CreateType)
-
@@ -151,8 +151,8 @@ func TestDeleteNew(t *testing.T) {a := DeleteNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != DeleteType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, DeleteType)
-
@@ -164,8 +164,8 @@ func TestDislikeNew(t *testing.T) {a := DislikeNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != DislikeType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, DislikeType)
-
@@ -177,8 +177,8 @@ func TestFlagNew(t *testing.T) {a := FlagNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != FlagType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, FlagType)
-
@@ -190,8 +190,8 @@ func TestFollowNew(t *testing.T) {a := FollowNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != FollowType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, FollowType)
-
@@ -203,8 +203,8 @@ func TestIgnoreNew(t *testing.T) {a := IgnoreNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != IgnoreType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, IgnoreType)
-
@@ -216,8 +216,8 @@ func TestInviteNew(t *testing.T) {a := InviteNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != InviteType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, InviteType)
-
@@ -229,8 +229,8 @@ func TestJoinNew(t *testing.T) {a := JoinNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != JoinType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, JoinType)
-
@@ -242,8 +242,8 @@ func TestLeaveNew(t *testing.T) {a := LeaveNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != LeaveType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, LeaveType)
-
@@ -255,8 +255,8 @@ func TestLikeNew(t *testing.T) {a := LikeNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != LikeType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, LikeType)
-
@@ -268,8 +268,8 @@ func TestListenNew(t *testing.T) {a := ListenNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != ListenType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, ListenType)
-
@@ -281,8 +281,8 @@ func TestMoveNew(t *testing.T) {a := MoveNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != MoveType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, MoveType)
-
@@ -294,8 +294,8 @@ func TestOfferNew(t *testing.T) {a := OfferNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != OfferType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, OfferType)
-
@@ -307,8 +307,8 @@ func TestQuestionNew(t *testing.T) {a := QuestionNew(testValue) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != QuestionType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, QuestionType)
-
@@ -320,8 +320,8 @@ func TestRejectNew(t *testing.T) {a := RejectNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != RejectType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, RejectType)
-
@@ -333,8 +333,8 @@ func TestReadNew(t *testing.T) {a := ReadNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != ReadType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, ReadType)
-
@@ -346,8 +346,8 @@ func TestRemoveNew(t *testing.T) {a := RemoveNew(testValue, nil, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != RemoveType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, RemoveType)
-
@@ -359,8 +359,8 @@ func TestTentativeRejectNew(t *testing.T) {a := TentativeRejectNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != TentativeRejectType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, TentativeRejectType)
-
@@ -372,8 +372,8 @@ func TestTentativeAcceptNew(t *testing.T) {a := TentativeAcceptNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != TentativeAcceptType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, TentativeAcceptType)
-
@@ -385,8 +385,8 @@ func TestTravelNew(t *testing.T) {a := TravelNew(testValue) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != TravelType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, TravelType)
-
@@ -398,8 +398,8 @@ func TestUndoNew(t *testing.T) {a := UndoNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != UndoType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, UndoType)
-
@@ -411,8 +411,8 @@ func TestUpdateNew(t *testing.T) {a := UpdateNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != UpdateType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, UpdateType)
-
@@ -424,8 +424,8 @@ func TestViewNew(t *testing.T) {a := ViewNew(testValue, nil) if a.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.Id, testValue) if a.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", a.ID, testValue) } if a.Type != ViewType { t.Errorf("Activity Type '%v' different than expected '%v'", a.Type, ViewType)
-
-
-
@@ -49,7 +49,7 @@ type Endpoints struct {// Actors are retrieved like any other Object in ActivityPub. // Like other ActivityStreams objects, actors have an id, which is a URI. 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"`
-
@@ -161,7 +161,7 @@ func (a Actor) IsObject() bool {// Object returns the apObject corresponding to the Actor object func (a Actor) Object() apObject { return *(a.apObject) return a.apObject } // Link returns the Link corresponding to the Actor object
-
@@ -181,7 +181,7 @@ func (p Person) IsObject() bool {// Object returns the apObject corresponding to the Person object func (p Person) Object() apObject { return *p.apObject return p.apObject } // Link returns the Link corresponding to the Person object
-
-
-
@@ -10,16 +10,16 @@ func TestActorNew(t *testing.T) {o := ActorNew(testValue, testType) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != testType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, testType) } n := ActorNew(testValue, "") if n.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", n.Id, testValue) if n.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", n.ID, testValue) } if n.Type != ActorType { t.Errorf("APObject Type '%v' different than expected '%v'", n.Type, ActorType)
-
@@ -30,8 +30,8 @@ func TestPersonNew(t *testing.T) {var testValue = ObjectID("test") o := PersonNew(testValue) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != PersonType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, PersonType)
-
@@ -42,8 +42,8 @@ func TestApplicationNew(t *testing.T) {var testValue = ObjectID("test") o := ApplicationNew(testValue) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != ApplicationType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, ApplicationType)
-
@@ -54,8 +54,8 @@ func TestGroupNew(t *testing.T) {var testValue = ObjectID("test") o := GroupNew(testValue) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != GroupType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, GroupType)
-
@@ -66,8 +66,8 @@ func TestOrganizationNew(t *testing.T) {var testValue = ObjectID("test") o := OrganizationNew(testValue) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != OrganizationType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, OrganizationType)
-
@@ -78,8 +78,8 @@ func TestServiceNew(t *testing.T) {var testValue = ObjectID("test") o := ServiceNew(testValue) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != ServiceType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, ServiceType)
-
-
-
@@ -7,7 +7,7 @@ type Page ObjectOrLink// Collection is a subtype of Object that represents ordered or unordered sets of Object or Link instances. 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"`
-
@@ -18,7 +18,7 @@ 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 { *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"`
-
-
-
@@ -7,8 +7,8 @@ func TestCollectionNew(t *testing.T) {c := CollectionNew(testValue) if c.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", c.Id, testValue) if c.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", c.ID, testValue) } if c.Type != CollectionType { t.Errorf("APObject Type '%v' different than expected '%v'", c.Type, CollectionType)
-
@@ -20,8 +20,8 @@ func TestOrderedCollectionNew(t *testing.T) {c := OrderedCollectionNew(testValue) if c.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", c.Id, testValue) if c.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", c.ID, testValue) } if c.Type != OrderedCollectionType { t.Errorf("APObject Type '%v' different than expected '%v'", c.Type, OrderedCollectionType)
-
-
-
@@ -2,8 +2,6 @@ package activitypubimport "time" //import "fmt" // CreateActivity is the type for a create activity message type CreateActivity struct { Activity *Create
-
@@ -13,7 +11,7 @@ type CreateActivity struct {} // CreateActivityNew initializes a new CreateActivity message func CreateActivityNew(id ObjectID, a ObjectOrLink, o ObjectOrLink) *CreateActivity { func CreateActivityNew(id ObjectID, a ObjectOrLink, o ObjectOrLink) CreateActivity { act := CreateNew(id, o) ok := false
-
@@ -34,7 +32,6 @@ func CreateActivityNew(id ObjectID, a ObjectOrLink, o ObjectOrLink) *CreateActivif typ == ServiceType { act.Actor, ok = a.(Service) } //fmt.Printf("type %v\nok is %t", act.Actor.Object(), ok) if !ok { act.Actor, ok = a.(Actor) }
-
@@ -45,5 +42,5 @@ func CreateActivityNew(id ObjectID, a ObjectOrLink, o ObjectOrLink) *CreateActivPublished: time.Now(), } return &c return c }
-
-
-
@@ -12,8 +12,8 @@ func TestCreateActivityNew(t *testing.T) {c := CreateActivityNew(testValue, nil, nil) now = time.Now() if c.Activity.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", c.Activity.Id, testValue) if c.Activity.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", c.Activity.ID, testValue) } if c.Activity.Type != CreateType { t.Errorf("Activity Type '%v' different than expected '%v'", c.Activity.Type, CreateType)
-
@@ -26,10 +26,10 @@ func TestCreateActivityNew(t *testing.T) {n := ObjectNew("my:note", NoteType) b := PersonNew("bob") c1 := CreateActivityNew(testValue, b, n) c1 := CreateActivityNew(testValue, *b, n) now = time.Now() if c1.Activity.Id != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", c1.Activity.Id, testValue) if c1.Activity.ID != testValue { t.Errorf("Activity Id '%v' different than expected '%v'", c1.Activity.ID, testValue) } if c1.Activity.Type != CreateType { t.Errorf("Activity Type '%v' different than expected '%v'", c1.Activity.Type, CreateType)
-
@@ -37,12 +37,10 @@ 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.Actor.Object().Name, b.Object().Name) { t.Errorf("Actor \n'%#v'\n\n different than expected \n\n'%#v'", c1.Activity.Actor.Object().Name, b.Object().Name) } */ if !reflect.DeepEqual(c1.Activity.Object.(*apObject), n) { if !reflect.DeepEqual(c1.Activity.Actor.Object().ID, b.Object().ID) { t.Errorf("Actor \n'%#v'\n\n different than expected \n\n'%#v'", c1.Activity.Actor.Object().ID, b.Object().ID) } if !reflect.DeepEqual(c1.Activity.Object.(apObject), n) { t.Errorf("Object \n'%#v'\n\n different than expected \n\n'%#v'\n", c1.Activity.Object, n) } }
-
-
-
@@ -130,7 +130,7 @@ func (n NaturalLanguageValue) MarshalJSON() ([]byte, error) {// including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection. type apObject struct { // Provides the globally unique identifier for an Activity Pub Object or Link. Id ObjectID `jsonld:"id,omitempty"` ID ObjectID `jsonld:"id,omitempty"` // 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.
-
@@ -177,7 +177,7 @@ type apObject struct {// The date and time at which the object was published Published time.Time `jsonld:"published,omitempty"` // Identifies a Collection containing objects considered to be responses to this object. Replies Collection `jsonld:"replies,omitempty"` Replies ObjectOrLink `jsonld:"replies,omitempty"` // 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.
-
@@ -185,22 +185,22 @@ 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 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"` // The date and time at which the object was updated Updated time.Time `jsonld:"updated,omitempty"` // Identifies one or more links to representations of the object Url LinkOrUri `jsonld:"url,omitempty"` URL LinkOrUri `jsonld:"url,omitempty"` // Identifies an entity considered to be part of the public primary audience of an Activity Pub Object To ObjectOrLink `jsonld:"to,omitempty"` // Identifies an Activity Pub Object that is part of the private primary audience of this Activity Pub Object. Bto ObjectOrLink `jsonld:"bto,omitempty"` // Identifies an Activity Pub Object that is part of the public secondary audience of this Activity Pub Object. Cc []ObjectOrLink `jsonld:"cc,omitempty"` Cc ObjectOrLink `jsonld:"cc,omitempty"` // Identifies one or more Objects that are part of the private secondary audience of this Activity Pub Object. Bcc []ObjectOrLink `jsonld:"bcc,omitempty"` 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. // The value must be expressed as an xsd:duration as defined by [ xmlschema11-2],
-
@@ -239,15 +239,15 @@ 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) return &o return o } // Object returns the apObject corresponding to the apObject object
-
-
-
@@ -10,16 +10,16 @@ func TestObjectNew(t *testing.T) {o := ObjectNew(testValue, testType) if o.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.Id, testValue) if o.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", o.ID, testValue) } if o.Type != testType { t.Errorf("APObject Type '%v' different than expected '%v'", o.Type, testType) } n := ObjectNew(testValue, "") if n.Id != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", n.Id, testValue) if n.ID != testValue { t.Errorf("APObject Id '%v' different than expected '%v'", n.ID, testValue) } if n.Type != ObjectType { t.Errorf("APObject Type '%v' different than expected '%v'", n.Type, ObjectType)
-
-
-
@@ -23,8 +23,8 @@ func TestAcceptSerialization(t *testing.T) {if !strings.Contains(string(data), string(ctx.URL)) { t.Errorf("Could not find context url %#v in output %s", ctx.URL, data) } if !strings.Contains(string(data), string(obj.Id)) { t.Errorf("Could not find id %#v in output %s", string(obj.Id), data) if !strings.Contains(string(data), string(obj.ID)) { t.Errorf("Could not find id %#v in output %s", string(obj.ID), data) } if !strings.Contains(string(data), string(obj.Name["en"])) { t.Errorf("Could not find name %#v in output %s", string(obj.Name["en"]), data)
-
@@ -53,8 +53,8 @@ func TestCreateActivityHTTPSerialization(t *testing.T) {if !strings.Contains(string(data), string(ctx.URL)) { t.Errorf("Could not find context url %#v in output %s", ctx.URL, data) } if !strings.Contains(string(data), string(obj.Id)) { t.Errorf("Could not find id %#v in output %s", string(obj.Id), data) if !strings.Contains(string(data), string(obj.ID)) { t.Errorf("Could not find id %#v in output %s", string(obj.ID), data) } if !strings.Contains(string(data), string(obj.Name["en"])) { t.Errorf("Could not find name %#v in output %s", string(obj.Name["en"]), data)
-