Removed the files with aliases for collections
This commit is contained in:
parent
4599863fae
commit
cf3741d6bb
|
@ -131,6 +131,22 @@ type Collection struct {
|
||||||
Items ItemCollection `jsonld:"items,omitempty"`
|
Items ItemCollection `jsonld:"items,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type (
|
||||||
|
// FollowersCollection is a collection of followers
|
||||||
|
FollowersCollection = Followers
|
||||||
|
|
||||||
|
// Followers is a Collection type
|
||||||
|
Followers = Collection
|
||||||
|
|
||||||
|
// FollowingCollection is a list of everybody that the actor has followed, added as a side effect.
|
||||||
|
// The following collection MUST be either an OrderedCollection or a Collection and MAY
|
||||||
|
// be filtered on privileges of an authenticated user or as appropriate when no authentication is given.
|
||||||
|
FollowingCollection = Following
|
||||||
|
|
||||||
|
// Following is a type alias for a simple Collection
|
||||||
|
Following = Collection
|
||||||
|
)
|
||||||
|
|
||||||
// CollectionNew initializes a new Collection
|
// CollectionNew initializes a new Collection
|
||||||
func CollectionNew(id ID) *Collection {
|
func CollectionNew(id ID) *Collection {
|
||||||
c := Collection{ID: id, Type: CollectionType}
|
c := Collection{ID: id, Type: CollectionType}
|
||||||
|
@ -293,3 +309,17 @@ func ToCollection(it Item) (*Collection, error) {
|
||||||
}
|
}
|
||||||
return nil, errors.New("unable to convert to collection")
|
return nil, errors.New("unable to convert to collection")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FollowingNew initializes a new Following
|
||||||
|
func FollowingNew() *Following {
|
||||||
|
id := ID("following")
|
||||||
|
|
||||||
|
i := Following{ID: id, Type: CollectionType}
|
||||||
|
i.Name = NaturalLanguageValuesNew()
|
||||||
|
i.Content = NaturalLanguageValuesNew()
|
||||||
|
i.Summary = NaturalLanguageValuesNew()
|
||||||
|
|
||||||
|
i.TotalItems = 0
|
||||||
|
|
||||||
|
return &i
|
||||||
|
}
|
||||||
|
|
|
@ -174,3 +174,10 @@ func TestCollection_IsCollection(t *testing.T) {
|
||||||
t.Skipf("TODO")
|
t.Skipf("TODO")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFollowersNew(t *testing.T) {
|
||||||
|
t.Skipf("TODO")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestFollowingNew(t *testing.T) {
|
||||||
|
t.Skipf("TODO")
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// FollowersCollection is a collection of followers
|
|
||||||
FollowersCollection = Followers
|
|
||||||
|
|
||||||
// Followers is a Collection type
|
|
||||||
Followers = Collection
|
|
||||||
)
|
|
|
@ -1,7 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestFollowersNew(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
25
following.go
25
following.go
|
@ -1,25 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// FollowingCollection is a list of everybody that the actor has followed, added as a side effect.
|
|
||||||
// The following collection MUST be either an OrderedCollection or a Collection and MAY
|
|
||||||
// be filtered on privileges of an authenticated user or as appropriate when no authentication is given.
|
|
||||||
FollowingCollection = Following
|
|
||||||
|
|
||||||
// Following is a type alias for a simple Collection
|
|
||||||
Following = Collection
|
|
||||||
)
|
|
||||||
|
|
||||||
// FollowingNew initializes a new Following
|
|
||||||
func FollowingNew() *Following {
|
|
||||||
id := ID("following")
|
|
||||||
|
|
||||||
i := Following{ID: id, Type: CollectionType}
|
|
||||||
i.Name = NaturalLanguageValuesNew()
|
|
||||||
i.Content = NaturalLanguageValuesNew()
|
|
||||||
i.Summary = NaturalLanguageValuesNew()
|
|
||||||
|
|
||||||
i.TotalItems = 0
|
|
||||||
|
|
||||||
return &i
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestFollowingNew(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
26
inbox.go
26
inbox.go
|
@ -1,26 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// InboxStream contains all activities received by the actor.
|
|
||||||
// The server SHOULD filter content according to the requester's permission.
|
|
||||||
// In general, the owner of an inbox is likely to be able to access all of their inbox contents.
|
|
||||||
// Depending on access control, some other content may be public, whereas other content may
|
|
||||||
// require authentication for non-owner users, if they can access the inbox at all.
|
|
||||||
InboxStream = Inbox
|
|
||||||
|
|
||||||
// Inbox is a type alias for an Ordered Collection
|
|
||||||
Inbox = OrderedCollection
|
|
||||||
)
|
|
||||||
|
|
||||||
// InboxNew initializes a new Inbox
|
|
||||||
func InboxNew() *OrderedCollection {
|
|
||||||
id := ID("inbox")
|
|
||||||
|
|
||||||
i := OrderedCollection{ID: id, Type: CollectionType}
|
|
||||||
i.Name = NaturalLanguageValuesNew()
|
|
||||||
i.Content = NaturalLanguageValuesNew()
|
|
||||||
|
|
||||||
i.TotalItems = 0
|
|
||||||
|
|
||||||
return &i
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestInboxNew(t *testing.T) {
|
|
||||||
i := InboxNew()
|
|
||||||
|
|
||||||
id := ID("inbox")
|
|
||||||
if i.ID != id {
|
|
||||||
t.Errorf("%T should be initialized with %q as %T", i, id, id)
|
|
||||||
}
|
|
||||||
if len(i.Name) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Name", i)
|
|
||||||
}
|
|
||||||
if len(i.Content) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Content", i)
|
|
||||||
}
|
|
||||||
if len(i.Summary) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Summary", i)
|
|
||||||
}
|
|
||||||
if i.TotalItems != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 TotalItems", i)
|
|
||||||
}
|
|
||||||
}
|
|
25
liked.go
25
liked.go
|
@ -1,25 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// LikedCollection is a list of every object from all of the actor's Like activities,
|
|
||||||
// added as a side effect. The liked collection MUST be either an OrderedCollection or
|
|
||||||
// a Collection and MAY be filtered on privileges of an authenticated user or as
|
|
||||||
// appropriate when no authentication is given.
|
|
||||||
LikedCollection = Liked
|
|
||||||
|
|
||||||
// Liked is a type alias for an Ordered Collection
|
|
||||||
Liked = OrderedCollection
|
|
||||||
)
|
|
||||||
|
|
||||||
// LikedCollection initializes a new Outbox
|
|
||||||
func LikedNew() *OrderedCollection {
|
|
||||||
id := ID("liked")
|
|
||||||
|
|
||||||
l := OrderedCollection{ID: id, Type: CollectionType}
|
|
||||||
l.Name = NaturalLanguageValuesNew()
|
|
||||||
l.Content = NaturalLanguageValuesNew()
|
|
||||||
|
|
||||||
l.TotalItems = 0
|
|
||||||
|
|
||||||
return &l
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestLikedNew(t *testing.T) {
|
|
||||||
l := LikedNew()
|
|
||||||
|
|
||||||
id := ID("liked")
|
|
||||||
if l.ID != id {
|
|
||||||
t.Errorf("%T should be initialized with %q as %T", l, id, id)
|
|
||||||
}
|
|
||||||
if len(l.Name) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Name", l)
|
|
||||||
}
|
|
||||||
if len(l.Content) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Content", l)
|
|
||||||
}
|
|
||||||
if len(l.Summary) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Summary", l)
|
|
||||||
}
|
|
||||||
if l.TotalItems != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 TotalItems", l)
|
|
||||||
}
|
|
||||||
}
|
|
25
likes.go
25
likes.go
|
@ -1,25 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// LikesCollection is a list of all Like activities with this object as the object property,
|
|
||||||
// added as a side effect. The likes collection MUST be either an OrderedCollection or a Collection
|
|
||||||
// and MAY be filtered on privileges of an authenticated user or as appropriate when
|
|
||||||
// no authentication is given.
|
|
||||||
LikesCollection = Likes
|
|
||||||
|
|
||||||
// Likes is a type alias for an Ordered Collection
|
|
||||||
Likes = OrderedCollection
|
|
||||||
)
|
|
||||||
|
|
||||||
// LikesCollection initializes a new Outbox
|
|
||||||
func LikesNew() *Likes {
|
|
||||||
id := ID("likes")
|
|
||||||
|
|
||||||
l := Likes{ID: id, Type: CollectionType}
|
|
||||||
l.Name = NaturalLanguageValuesNew()
|
|
||||||
l.Content = NaturalLanguageValuesNew()
|
|
||||||
|
|
||||||
l.TotalItems = 0
|
|
||||||
|
|
||||||
return &l
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestLikesNew(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
|
@ -114,6 +114,53 @@ type OrderedCollection struct {
|
||||||
OrderedItems ItemCollection `jsonld:"orderedItems,omitempty"`
|
OrderedItems ItemCollection `jsonld:"orderedItems,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type (
|
||||||
|
// InboxStream contains all activities received by the actor.
|
||||||
|
// The server SHOULD filter content according to the requester's permission.
|
||||||
|
// In general, the owner of an inbox is likely to be able to access all of their inbox contents.
|
||||||
|
// Depending on access control, some other content may be public, whereas other content may
|
||||||
|
// require authentication for non-owner users, if they can access the inbox at all.
|
||||||
|
InboxStream = Inbox
|
||||||
|
|
||||||
|
// Inbox is a type alias for an Ordered Collection
|
||||||
|
Inbox = OrderedCollection
|
||||||
|
|
||||||
|
// LikedCollection is a list of every object from all of the actor's Like activities,
|
||||||
|
// added as a side effect. The liked collection MUST be either an OrderedCollection or
|
||||||
|
// a Collection and MAY be filtered on privileges of an authenticated user or as
|
||||||
|
// appropriate when no authentication is given.
|
||||||
|
LikedCollection = Liked
|
||||||
|
|
||||||
|
// Liked is a type alias for an Ordered Collection
|
||||||
|
Liked = OrderedCollection
|
||||||
|
|
||||||
|
// LikesCollection is a list of all Like activities with this object as the object property,
|
||||||
|
// added as a side effect. The likes collection MUST be either an OrderedCollection or a Collection
|
||||||
|
// and MAY be filtered on privileges of an authenticated user or as appropriate when
|
||||||
|
// no authentication is given.
|
||||||
|
LikesCollection = Likes
|
||||||
|
|
||||||
|
// Likes is a type alias for an Ordered Collection
|
||||||
|
Likes = OrderedCollection
|
||||||
|
|
||||||
|
// OutboxStream contains activities the user has published,
|
||||||
|
// subject to the ability of the requestor to retrieve the activity (that is,
|
||||||
|
// the contents of the outbox are filtered by the permissions of the person reading it).
|
||||||
|
OutboxStream = Outbox
|
||||||
|
|
||||||
|
// Outbox is a type alias for an Ordered Collection
|
||||||
|
Outbox = OrderedCollection
|
||||||
|
|
||||||
|
// SharesCollection is a list of all Announce activities with this object as the object property,
|
||||||
|
// added as a side effect. The shares collection MUST be either an OrderedCollection or a Collection
|
||||||
|
// and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication
|
||||||
|
// is given.
|
||||||
|
SharesCollection = Shares
|
||||||
|
|
||||||
|
// Shares is a type alias for an Ordered Collection
|
||||||
|
Shares = OrderedCollection
|
||||||
|
)
|
||||||
|
|
||||||
// GetType returns the OrderedCollection's type
|
// GetType returns the OrderedCollection's type
|
||||||
func (o OrderedCollection) GetType() ActivityVocabularyType {
|
func (o OrderedCollection) GetType() ActivityVocabularyType {
|
||||||
return o.Type
|
return o.Type
|
||||||
|
@ -306,3 +353,68 @@ func copyOrderedCollectionToPage(c *OrderedCollection, p *OrderedCollectionPage)
|
||||||
p.PartOf = c.GetLink()
|
p.PartOf = c.GetLink()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InboxNew initializes a new Inbox
|
||||||
|
func InboxNew() *OrderedCollection {
|
||||||
|
id := ID("inbox")
|
||||||
|
|
||||||
|
i := OrderedCollection{ID: id, Type: CollectionType}
|
||||||
|
i.Name = NaturalLanguageValuesNew()
|
||||||
|
i.Content = NaturalLanguageValuesNew()
|
||||||
|
|
||||||
|
i.TotalItems = 0
|
||||||
|
|
||||||
|
return &i
|
||||||
|
}
|
||||||
|
|
||||||
|
// LikedCollection initializes a new Outbox
|
||||||
|
func LikedNew() *OrderedCollection {
|
||||||
|
id := ID("liked")
|
||||||
|
|
||||||
|
l := OrderedCollection{ID: id, Type: CollectionType}
|
||||||
|
l.Name = NaturalLanguageValuesNew()
|
||||||
|
l.Content = NaturalLanguageValuesNew()
|
||||||
|
|
||||||
|
l.TotalItems = 0
|
||||||
|
|
||||||
|
return &l
|
||||||
|
}
|
||||||
|
|
||||||
|
// LikesCollection initializes a new Outbox
|
||||||
|
func LikesNew() *Likes {
|
||||||
|
id := ID("likes")
|
||||||
|
|
||||||
|
l := Likes{ID: id, Type: CollectionType}
|
||||||
|
l.Name = NaturalLanguageValuesNew()
|
||||||
|
l.Content = NaturalLanguageValuesNew()
|
||||||
|
|
||||||
|
l.TotalItems = 0
|
||||||
|
|
||||||
|
return &l
|
||||||
|
}
|
||||||
|
|
||||||
|
// OutboxNew initializes a new Outbox
|
||||||
|
func OutboxNew() *Outbox {
|
||||||
|
id := ID("outbox")
|
||||||
|
|
||||||
|
i := Outbox{ID: id, Type: OrderedCollectionType}
|
||||||
|
i.Name = NaturalLanguageValuesNew()
|
||||||
|
i.Content = NaturalLanguageValuesNew()
|
||||||
|
i.TotalItems = 0
|
||||||
|
i.OrderedItems = make(ItemCollection, 0)
|
||||||
|
|
||||||
|
return &i
|
||||||
|
}
|
||||||
|
|
||||||
|
// SharesNew initializes a new Shares
|
||||||
|
func SharesNew() *Shares {
|
||||||
|
id := ID("Shares")
|
||||||
|
|
||||||
|
i := Shares{ID: id, Type: CollectionType}
|
||||||
|
i.Name = NaturalLanguageValuesNew()
|
||||||
|
i.Content = NaturalLanguageValuesNew()
|
||||||
|
|
||||||
|
i.TotalItems = 0
|
||||||
|
|
||||||
|
return &i
|
||||||
|
}
|
||||||
|
|
|
@ -215,3 +215,74 @@ func TestToOrderedCollection(t *testing.T) {
|
||||||
func TestOrderedCollection_Contains(t *testing.T) {
|
func TestOrderedCollection_Contains(t *testing.T) {
|
||||||
t.Skipf("TODO")
|
t.Skipf("TODO")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestInboxNew(t *testing.T) {
|
||||||
|
i := InboxNew()
|
||||||
|
|
||||||
|
id := ID("inbox")
|
||||||
|
if i.ID != id {
|
||||||
|
t.Errorf("%T should be initialized with %q as %T", i, id, id)
|
||||||
|
}
|
||||||
|
if len(i.Name) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Name", i)
|
||||||
|
}
|
||||||
|
if len(i.Content) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Content", i)
|
||||||
|
}
|
||||||
|
if len(i.Summary) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Summary", i)
|
||||||
|
}
|
||||||
|
if i.TotalItems != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 TotalItems", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLikedNew(t *testing.T) {
|
||||||
|
l := LikedNew()
|
||||||
|
|
||||||
|
id := ID("liked")
|
||||||
|
if l.ID != id {
|
||||||
|
t.Errorf("%T should be initialized with %q as %T", l, id, id)
|
||||||
|
}
|
||||||
|
if len(l.Name) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Name", l)
|
||||||
|
}
|
||||||
|
if len(l.Content) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Content", l)
|
||||||
|
}
|
||||||
|
if len(l.Summary) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Summary", l)
|
||||||
|
}
|
||||||
|
if l.TotalItems != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 TotalItems", l)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLikesNew(t *testing.T) {
|
||||||
|
t.Skipf("TODO")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestOutboxNew(t *testing.T) {
|
||||||
|
o := OutboxNew()
|
||||||
|
|
||||||
|
id := ID("outbox")
|
||||||
|
if o.ID != id {
|
||||||
|
t.Errorf("%T should be initialized with %q as %T", o, id, id)
|
||||||
|
}
|
||||||
|
if len(o.Name) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Name", o)
|
||||||
|
}
|
||||||
|
if len(o.Content) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Content", o)
|
||||||
|
}
|
||||||
|
if len(o.Summary) != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 length Summary", o)
|
||||||
|
}
|
||||||
|
if o.TotalItems != 0 {
|
||||||
|
t.Errorf("%T should be initialized with 0 TotalItems", o)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSharesNew(t *testing.T) {
|
||||||
|
t.Skipf("TODO")
|
||||||
|
}
|
||||||
|
|
24
outbox.go
24
outbox.go
|
@ -1,24 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// OutboxStream contains activities the user has published,
|
|
||||||
// subject to the ability of the requestor to retrieve the activity (that is,
|
|
||||||
// the contents of the outbox are filtered by the permissions of the person reading it).
|
|
||||||
OutboxStream = Outbox
|
|
||||||
|
|
||||||
// Outbox is a type alias for an Ordered Collection
|
|
||||||
Outbox = OrderedCollection
|
|
||||||
)
|
|
||||||
|
|
||||||
// OutboxNew initializes a new Outbox
|
|
||||||
func OutboxNew() *Outbox {
|
|
||||||
id := ID("outbox")
|
|
||||||
|
|
||||||
i := Outbox{ID: id, Type: OrderedCollectionType}
|
|
||||||
i.Name = NaturalLanguageValuesNew()
|
|
||||||
i.Content = NaturalLanguageValuesNew()
|
|
||||||
i.TotalItems = 0
|
|
||||||
i.OrderedItems = make(ItemCollection, 0)
|
|
||||||
|
|
||||||
return &i
|
|
||||||
}
|
|
102
outbox_test.go
102
outbox_test.go
|
@ -1,102 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestOutboxNew(t *testing.T) {
|
|
||||||
o := OutboxNew()
|
|
||||||
|
|
||||||
id := ID("outbox")
|
|
||||||
if o.ID != id {
|
|
||||||
t.Errorf("%T should be initialized with %q as %T", o, id, id)
|
|
||||||
}
|
|
||||||
if len(o.Name) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Name", o)
|
|
||||||
}
|
|
||||||
if len(o.Content) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Content", o)
|
|
||||||
}
|
|
||||||
if len(o.Summary) != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 length Summary", o)
|
|
||||||
}
|
|
||||||
if o.TotalItems != 0 {
|
|
||||||
t.Errorf("%T should be initialized with 0 TotalItems", o)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutboxStream_GetID(t *testing.T) {
|
|
||||||
o := OutboxStream{}
|
|
||||||
if o.GetID() != "" {
|
|
||||||
t.Errorf("%T should be initialized with empty %T", o, o.GetID())
|
|
||||||
}
|
|
||||||
id := ID("test_out_stream")
|
|
||||||
o.ID = id
|
|
||||||
if o.GetID() != id {
|
|
||||||
t.Errorf("%T should have %T as %q", o, id, id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutboxStream_GetType(t *testing.T) {
|
|
||||||
o := OutboxStream{}
|
|
||||||
|
|
||||||
if o.GetType() != "" {
|
|
||||||
t.Errorf("%T should be initialized with empty %T", o, o.GetType())
|
|
||||||
}
|
|
||||||
|
|
||||||
o.Type = OrderedCollectionType
|
|
||||||
if o.GetType() != OrderedCollectionType {
|
|
||||||
t.Errorf("%T should have %T as %q", o, o.GetType(), OrderedCollectionType)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutboxStream_Append(t *testing.T) {
|
|
||||||
o := OutboxStream{}
|
|
||||||
|
|
||||||
val := Object{ID: ID("grrr")}
|
|
||||||
|
|
||||||
o.Append(val)
|
|
||||||
if !reflect.DeepEqual(o.OrderedItems[0], val) {
|
|
||||||
t.Errorf("First item in %T.%T does not match %q", o, o.OrderedItems, val.ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_Append(t *testing.T) {
|
|
||||||
o := OutboxNew()
|
|
||||||
|
|
||||||
val := Object{ID: ID("grrr")}
|
|
||||||
|
|
||||||
o.Append(val)
|
|
||||||
if !reflect.DeepEqual(o.OrderedItems[0], val) {
|
|
||||||
t.Errorf("First item in %T.%T does not match %q", o, o.OrderedItems, val.ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_Collection(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_GetID(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_GetLink(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_GetType(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_IsLink(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_IsObject(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOutbox_UnmarshalJSON(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
25
shares.go
25
shares.go
|
@ -1,25 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
type (
|
|
||||||
// SharesCollection is a list of all Announce activities with this object as the object property,
|
|
||||||
// added as a side effect. The shares collection MUST be either an OrderedCollection or a Collection
|
|
||||||
// and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication
|
|
||||||
// is given.
|
|
||||||
SharesCollection = Shares
|
|
||||||
|
|
||||||
// Shares is a type alias for an Ordered Collection
|
|
||||||
Shares = OrderedCollection
|
|
||||||
)
|
|
||||||
|
|
||||||
// SharesNew initializes a new Shares
|
|
||||||
func SharesNew() *Shares {
|
|
||||||
id := ID("Shares")
|
|
||||||
|
|
||||||
i := Shares{ID: id, Type: CollectionType}
|
|
||||||
i.Name = NaturalLanguageValuesNew()
|
|
||||||
i.Content = NaturalLanguageValuesNew()
|
|
||||||
|
|
||||||
i.TotalItems = 0
|
|
||||||
|
|
||||||
return &i
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package activitypub
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestSharesNew(t *testing.T) {
|
|
||||||
t.Skipf("TODO")
|
|
||||||
}
|
|
Reference in a new issue