flabk/flabk/ap/object.go

37 lines
958 B
Go

package ap
import (
"github.com/go-ap/jsonld"
)
type Object struct {
Context jsonld.Context `jsonld:"@context,omitempty,collapsible"`
Type string `jsonld:"type"`
Type2 string `jsonld:"@type"`
ID jsonld.IRI `jsonld:"id,omitempty"`
Name string `jsonld:"name,omitempty"`
Source *Source `jsonld:"source,omitempty"`
To []Object `jsonld:"to,omitempty,collapsible"`
CC []Object `jsonld:"cc,omitempty,collapsible"`
Object *Object `jsonld:"object,omitempty,collapsible"`
Actor *Actor `jsonld:"actor,omitempty,collapsible"`
}
func (o Object) Collapse() interface{} {
return o.ID
}
type Actor struct {
ID jsonld.IRI `jsonld:"id,omitempty"`
Name string `jsonld:"name,omitempty"`
}
func (a Actor) Collapse() interface{} {
return a.ID
}
type Source struct {
Content string `jsonld:"content,omitempty"`
MediaType string `jsonld:"mediaType,omitempty"`
}