Package schemaorg provides an implementation of the schema.org vocabulary, as they are used on the Fediverse, for the Go programming language.
Use https://github.com/reiver/go-jsonld to marshal types in this package.
import (
"github.com/reiver/go-activitystreams"
"github.com/reiver/go-jsonld"
"github.com/reiver/go-schemaorg"
)
// ...
var person = activitystreams.Person{
// ...
Attachments: []any{
schemaorg.PropertyValue{
Name: "Location",
Value: "Metro Vancouver",
},
schemaorg.PropertyValue{
Name: "Home-Page",
Value: "http://example.com/~joeblow",
},
},
// ...
}.
// ...
bytes, err := jsonld.Marshal()
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-schemaorg
To import package schemaorg use import
code like the follownig:
import "github.com/reiver/go-schemaorg"
To install package schemaorg do the following:
GOPROXY=direct go get github.com/reiver/go-schemaorg
Package schemaorg was written by Charles Iliya Krempeaux