Move namespace string into const

This commit is contained in:
Matt Baer
2018-08-04 14:23:14 +02:00
parent 57919aaaec
commit 26688eb59d
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -5,7 +5,8 @@ import (
)
const (
toPublic = "https://www.w3.org/ns/activitystreams#Public"
Namespace = "https://www.w3.org/ns/activitystreams"
toPublic = "https://www.w3.org/ns/activitystreams#Public"
)
type Activity struct {
@@ -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",
+2 -2
View File
@@ -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",
+1 -1
View File
@@ -20,7 +20,7 @@ func NewPerson(accountRoot string) *Person {
BaseObject: BaseObject{
Type: "Person",
Context: []interface{}{
"https://www.w3.org/ns/activitystreams",
Namespace,
},
ID: accountRoot,
},