Move namespace string into const
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
Namespace = "https://www.w3.org/ns/activitystreams"
|
||||
toPublic = "https://www.w3.org/ns/activitystreams#Public"
|
||||
)
|
||||
|
||||
@@ -21,7 +22,7 @@ func NewCreateActivity(o *Object) *Activity {
|
||||
a := Activity{
|
||||
BaseObject: BaseObject{
|
||||
Context: []interface{}{
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
Namespace,
|
||||
},
|
||||
ID: o.ID + "/activity",
|
||||
Type: "Create",
|
||||
|
||||
@@ -38,7 +38,7 @@ func NewOrderedCollection(accountRoot, collType string, items int) *OrderedColle
|
||||
oc := OrderedCollection{
|
||||
BaseObject: BaseObject{
|
||||
Context: []interface{}{
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
Namespace,
|
||||
},
|
||||
ID: accountRoot + "/" + collType,
|
||||
Type: "OrderedCollection",
|
||||
@@ -62,7 +62,7 @@ func NewOrderedCollectionPage(accountRoot, collType string, items, page int) *Or
|
||||
ocp := OrderedCollectionPage{
|
||||
BaseObject: BaseObject{
|
||||
Context: []interface{}{
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
Namespace,
|
||||
},
|
||||
ID: fmt.Sprintf("%s/%s?page=%d", accountRoot, collType, page),
|
||||
Type: "OrderedCollectionPage",
|
||||
|
||||
@@ -20,7 +20,7 @@ func NewPerson(accountRoot string) *Person {
|
||||
BaseObject: BaseObject{
|
||||
Type: "Person",
|
||||
Context: []interface{}{
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
Namespace,
|
||||
},
|
||||
ID: accountRoot,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user