-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
package jsonld
import (
"encoding/json"
"activitypub"
)
type Ref string
type Context struct {
URL Ref `jsonld:"@url"`
Language activitypub.NaturalLanguageValue `jsonld:"@language,omitempty,collapsible"`
}
func (c *Context) Ref() Ref {
return Ref(c.URL)
}
func (r *Ref) MarshalText() ([]byte, error) {
return []byte(*r), nil
}
func (c *Context) MarshalJSON() ([]byte, error) {
var a map[string]interface{}
a = reflectToJsonLdMap(c)
return json.Marshal(a)
}