Grand test fixup (#138)

* start fixing up tests

* fix up tests + automate with drone

* fiddle with linting

* messing about with drone.yml

* some more fiddling

* hmmm

* add cache

* add vendor directory

* verbose

* ci updates

* update some little things

* update sig
This commit is contained in:
Tobi Smethurst
2021-08-12 21:03:24 +02:00
committed by GitHub
parent 329a5e8144
commit 98263a7de6
2677 changed files with 1090869 additions and 219 deletions

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyaccuracy contains the implementation for the accuracy property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyaccuracy

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyaccuracy
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,203 @@
// Code generated by astool. DO NOT EDIT.
package propertyaccuracy
import (
"fmt"
float "github.com/go-fed/activity/streams/values/float"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsAccuracyProperty is the functional property "accuracy". It is
// permitted to be a single default-valued value type.
type ActivityStreamsAccuracyProperty struct {
xmlschemaFloatMember float64
hasFloatMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeAccuracyProperty creates a "accuracy" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeAccuracyProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsAccuracyProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "accuracy"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "accuracy")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsAccuracyProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := float.DeserializeFloat(i); err == nil {
this := &ActivityStreamsAccuracyProperty{
alias: alias,
hasFloatMember: true,
xmlschemaFloatMember: v,
}
return this, nil
}
this := &ActivityStreamsAccuracyProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsAccuracyProperty creates a new accuracy property.
func NewActivityStreamsAccuracyProperty() *ActivityStreamsAccuracyProperty {
return &ActivityStreamsAccuracyProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaFloat
// afterwards will return false.
func (this *ActivityStreamsAccuracyProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasFloatMember = false
}
// Get returns the value of this property. When IsXMLSchemaFloat returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsAccuracyProperty) Get() float64 {
return this.xmlschemaFloatMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsAccuracyProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsAccuracyProperty) HasAny() bool {
return this.IsXMLSchemaFloat() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsAccuracyProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaFloat returns true if this property is set and not an IRI.
func (this ActivityStreamsAccuracyProperty) IsXMLSchemaFloat() bool {
return this.hasFloatMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsAccuracyProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsAccuracyProperty) KindIndex() int {
if this.IsXMLSchemaFloat() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsAccuracyProperty) LessThan(o vocab.ActivityStreamsAccuracyProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaFloat() && !o.IsXMLSchemaFloat() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaFloat() && !o.IsXMLSchemaFloat() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaFloat() && o.IsXMLSchemaFloat() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return float.LessFloat(this.Get(), o.Get())
}
}
// Name returns the name of this property: "accuracy".
func (this ActivityStreamsAccuracyProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "accuracy"
} else {
return "accuracy"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsAccuracyProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaFloat() {
return float.SerializeFloat(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaFloat afterwards will
// return true.
func (this *ActivityStreamsAccuracyProperty) Set(v float64) {
this.Clear()
this.xmlschemaFloatMember = v
this.hasFloatMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsAccuracyProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyactor contains the implementation for the actor property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyactor

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyactor
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyaltitude contains the implementation for the altitude property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyaltitude

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyaltitude
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,203 @@
// Code generated by astool. DO NOT EDIT.
package propertyaltitude
import (
"fmt"
float "github.com/go-fed/activity/streams/values/float"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsAltitudeProperty is the functional property "altitude". It is
// permitted to be a single default-valued value type.
type ActivityStreamsAltitudeProperty struct {
xmlschemaFloatMember float64
hasFloatMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeAltitudeProperty creates a "altitude" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeAltitudeProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsAltitudeProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "altitude"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "altitude")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsAltitudeProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := float.DeserializeFloat(i); err == nil {
this := &ActivityStreamsAltitudeProperty{
alias: alias,
hasFloatMember: true,
xmlschemaFloatMember: v,
}
return this, nil
}
this := &ActivityStreamsAltitudeProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsAltitudeProperty creates a new altitude property.
func NewActivityStreamsAltitudeProperty() *ActivityStreamsAltitudeProperty {
return &ActivityStreamsAltitudeProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaFloat
// afterwards will return false.
func (this *ActivityStreamsAltitudeProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasFloatMember = false
}
// Get returns the value of this property. When IsXMLSchemaFloat returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsAltitudeProperty) Get() float64 {
return this.xmlschemaFloatMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsAltitudeProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsAltitudeProperty) HasAny() bool {
return this.IsXMLSchemaFloat() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsAltitudeProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaFloat returns true if this property is set and not an IRI.
func (this ActivityStreamsAltitudeProperty) IsXMLSchemaFloat() bool {
return this.hasFloatMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsAltitudeProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsAltitudeProperty) KindIndex() int {
if this.IsXMLSchemaFloat() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsAltitudeProperty) LessThan(o vocab.ActivityStreamsAltitudeProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaFloat() && !o.IsXMLSchemaFloat() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaFloat() && !o.IsXMLSchemaFloat() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaFloat() && o.IsXMLSchemaFloat() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return float.LessFloat(this.Get(), o.Get())
}
}
// Name returns the name of this property: "altitude".
func (this ActivityStreamsAltitudeProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "altitude"
} else {
return "altitude"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsAltitudeProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaFloat() {
return float.SerializeFloat(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaFloat afterwards will
// return true.
func (this *ActivityStreamsAltitudeProperty) Set(v float64) {
this.Clear()
this.xmlschemaFloatMember = v
this.hasFloatMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsAltitudeProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyanyof contains the implementation for the anyOf property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyanyof

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyanyof
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyattachment contains the implementation for the attachment
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyattachment

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyattachment
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyattributedto contains the implementation for the attributedTo
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyattributedto

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyattributedto
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyaudience contains the implementation for the audience property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyaudience

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyaudience
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertybcc contains the implementation for the bcc property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertybcc

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertybcc
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertybto contains the implementation for the bto property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertybto

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertybto
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertycc contains the implementation for the cc property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertycc

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertycc
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyclosed contains the implementation for the closed property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyclosed

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyclosed
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertycontent contains the implementation for the content property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertycontent

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertycontent
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,668 @@
// Code generated by astool. DO NOT EDIT.
package propertycontent
import (
"fmt"
langstring "github.com/go-fed/activity/streams/values/langString"
string1 "github.com/go-fed/activity/streams/values/string"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsContentPropertyIterator is an iterator for a property. It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsContentPropertyIterator struct {
xmlschemaStringMember string
hasStringMember bool
rdfLangStringMember map[string]string
unknown interface{}
iri *url.URL
alias string
myIdx int
parent vocab.ActivityStreamsContentProperty
}
// NewActivityStreamsContentPropertyIterator creates a new ActivityStreamsContent
// property.
func NewActivityStreamsContentPropertyIterator() *ActivityStreamsContentPropertyIterator {
return &ActivityStreamsContentPropertyIterator{alias: ""}
}
// deserializeActivityStreamsContentPropertyIterator creates an iterator from an
// element that has been unmarshalled from a text or binary format.
func deserializeActivityStreamsContentPropertyIterator(i interface{}, aliasMap map[string]string) (*ActivityStreamsContentPropertyIterator, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsContentPropertyIterator{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := string1.DeserializeString(i); err == nil {
this := &ActivityStreamsContentPropertyIterator{
alias: alias,
hasStringMember: true,
xmlschemaStringMember: v,
}
return this, nil
} else if v, err := langstring.DeserializeLangString(i); err == nil {
this := &ActivityStreamsContentPropertyIterator{
alias: alias,
rdfLangStringMember: v,
}
return this, nil
}
this := &ActivityStreamsContentPropertyIterator{
alias: alias,
unknown: i,
}
return this, nil
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsContentPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetLanguage returns the value for the specified BCP47 language code, or an
// empty string if it is either not a language map or no value is present.
func (this ActivityStreamsContentPropertyIterator) GetLanguage(bcp47 string) string {
if this.rdfLangStringMember == nil {
return ""
} else if v, ok := this.rdfLangStringMember[bcp47]; ok {
return v
} else {
return ""
}
}
// GetRDFLangString returns the value of this property. When IsRDFLangString
// returns false, GetRDFLangString will return an arbitrary value.
func (this ActivityStreamsContentPropertyIterator) GetRDFLangString() map[string]string {
return this.rdfLangStringMember
}
// GetXMLSchemaString returns the value of this property. When IsXMLSchemaString
// returns false, GetXMLSchemaString will return an arbitrary value.
func (this ActivityStreamsContentPropertyIterator) GetXMLSchemaString() string {
return this.xmlschemaStringMember
}
// HasAny returns true if any of the values are set, except for the natural
// language map. When true, the specific has, getter, and setter methods may
// be used to determine what kind of value there is to access and set this
// property. To determine if the property was set as a natural language map,
// use the IsRDFLangString method instead.
func (this ActivityStreamsContentPropertyIterator) HasAny() bool {
return this.IsXMLSchemaString() ||
this.IsRDFLangString() ||
this.iri != nil
}
// HasLanguage returns true if the natural language map has an entry for the
// specified BCP47 language code.
func (this ActivityStreamsContentPropertyIterator) HasLanguage(bcp47 string) bool {
if this.rdfLangStringMember == nil {
return false
} else {
_, ok := this.rdfLangStringMember[bcp47]
return ok
}
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsContentPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsRDFLangString returns true if this property has a type of "langString". When
// true, use the GetRDFLangString and SetRDFLangString methods to access and
// set this property.. To determine if the property was set as a natural
// language map, use the IsRDFLangString method instead.
func (this ActivityStreamsContentPropertyIterator) IsRDFLangString() bool {
return this.rdfLangStringMember != nil
}
// IsXMLSchemaString returns true if this property has a type of "string". When
// true, use the GetXMLSchemaString and SetXMLSchemaString methods to access
// and set this property.. To determine if the property was set as a natural
// language map, use the IsRDFLangString method instead.
func (this ActivityStreamsContentPropertyIterator) IsXMLSchemaString() bool {
return this.hasStringMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsContentPropertyIterator) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsContentPropertyIterator) KindIndex() int {
if this.IsXMLSchemaString() {
return 0
}
if this.IsRDFLangString() {
return 1
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsContentPropertyIterator) LessThan(o vocab.ActivityStreamsContentPropertyIterator) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsXMLSchemaString() {
return string1.LessString(this.GetXMLSchemaString(), o.GetXMLSchemaString())
} else if this.IsRDFLangString() {
return langstring.LessLangString(this.GetRDFLangString(), o.GetRDFLangString())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "ActivityStreamsContent".
func (this ActivityStreamsContentPropertyIterator) Name() string {
if this.IsRDFLangString() {
return "ActivityStreamsContentMap"
} else {
return "ActivityStreamsContent"
}
}
// Next returns the next iterator, or nil if there is no next iterator.
func (this ActivityStreamsContentPropertyIterator) Next() vocab.ActivityStreamsContentPropertyIterator {
if this.myIdx+1 >= this.parent.Len() {
return nil
} else {
return this.parent.At(this.myIdx + 1)
}
}
// Prev returns the previous iterator, or nil if there is no previous iterator.
func (this ActivityStreamsContentPropertyIterator) Prev() vocab.ActivityStreamsContentPropertyIterator {
if this.myIdx-1 < 0 {
return nil
} else {
return this.parent.At(this.myIdx - 1)
}
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsContentPropertyIterator) SetIRI(v *url.URL) {
this.clear()
this.iri = v
}
// SetLanguage sets the value for the specified BCP47 language code.
func (this *ActivityStreamsContentPropertyIterator) SetLanguage(bcp47, value string) {
this.hasStringMember = false
this.rdfLangStringMember = nil
this.unknown = nil
this.iri = nil
if this.rdfLangStringMember == nil {
this.rdfLangStringMember = make(map[string]string)
}
this.rdfLangStringMember[bcp47] = value
}
// SetRDFLangString sets the value of this property and clears the natural
// language map. Calling IsRDFLangString afterwards will return true. Calling
// IsRDFLangString afterwards returns false.
func (this *ActivityStreamsContentPropertyIterator) SetRDFLangString(v map[string]string) {
this.clear()
this.rdfLangStringMember = v
}
// SetXMLSchemaString sets the value of this property and clears the natural
// language map. Calling IsXMLSchemaString afterwards will return true.
// Calling IsRDFLangString afterwards returns false.
func (this *ActivityStreamsContentPropertyIterator) SetXMLSchemaString(v string) {
this.clear()
this.xmlschemaStringMember = v
this.hasStringMember = true
}
// clear ensures no value and no language map for this property is set. Calling
// HasAny or any of the 'Is' methods afterwards will return false.
func (this *ActivityStreamsContentPropertyIterator) clear() {
this.hasStringMember = false
this.rdfLangStringMember = nil
this.unknown = nil
this.iri = nil
this.rdfLangStringMember = nil
}
// serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsContentPropertyIterator) serialize() (interface{}, error) {
if this.IsXMLSchemaString() {
return string1.SerializeString(this.GetXMLSchemaString())
} else if this.IsRDFLangString() {
return langstring.SerializeLangString(this.GetRDFLangString())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// ActivityStreamsContentProperty is the non-functional property "content". It is
// permitted to have one or more values, and of different value types.
type ActivityStreamsContentProperty struct {
properties []*ActivityStreamsContentPropertyIterator
alias string
}
// DeserializeContentProperty creates a "content" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeContentProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsContentProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "content"
if len(alias) > 0 {
propName = fmt.Sprintf("%s:%s", alias, "content")
}
i, ok := m[propName]
if !ok {
// Attempt to find the map instead.
i, ok = m[propName+"Map"]
}
if ok {
this := &ActivityStreamsContentProperty{
alias: alias,
properties: []*ActivityStreamsContentPropertyIterator{},
}
if list, ok := i.([]interface{}); ok {
for _, iterator := range list {
if p, err := deserializeActivityStreamsContentPropertyIterator(iterator, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
} else {
if p, err := deserializeActivityStreamsContentPropertyIterator(i, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
// Set up the properties for iteration.
for idx, ele := range this.properties {
ele.parent = this
ele.myIdx = idx
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsContentProperty creates a new content property.
func NewActivityStreamsContentProperty() *ActivityStreamsContentProperty {
return &ActivityStreamsContentProperty{alias: ""}
}
// AppendIRI appends an IRI value to the back of a list of the property "content"
func (this *ActivityStreamsContentProperty) AppendIRI(v *url.URL) {
this.properties = append(this.properties, &ActivityStreamsContentPropertyIterator{
alias: this.alias,
iri: v,
myIdx: this.Len(),
parent: this,
})
}
// AppendRDFLangString appends a langString value to the back of a list of the
// property "content". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsContentProperty) AppendRDFLangString(v map[string]string) {
this.properties = append(this.properties, &ActivityStreamsContentPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
rdfLangStringMember: v,
})
}
// AppendXMLSchemaString appends a string value to the back of a list of the
// property "content". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsContentProperty) AppendXMLSchemaString(v string) {
this.properties = append(this.properties, &ActivityStreamsContentPropertyIterator{
alias: this.alias,
hasStringMember: true,
myIdx: this.Len(),
parent: this,
xmlschemaStringMember: v,
})
}
// At returns the property value for the specified index. Panics if the index is
// out of bounds.
func (this ActivityStreamsContentProperty) At(index int) vocab.ActivityStreamsContentPropertyIterator {
return this.properties[index]
}
// Begin returns the first iterator, or nil if empty. Can be used with the
// iterator's Next method and this property's End method to iterate from front
// to back through all values.
func (this ActivityStreamsContentProperty) Begin() vocab.ActivityStreamsContentPropertyIterator {
if this.Empty() {
return nil
} else {
return this.properties[0]
}
}
// Empty returns returns true if there are no elements.
func (this ActivityStreamsContentProperty) Empty() bool {
return this.Len() == 0
}
// End returns beyond-the-last iterator, which is nil. Can be used with the
// iterator's Next method and this property's Begin method to iterate from
// front to back through all values.
func (this ActivityStreamsContentProperty) End() vocab.ActivityStreamsContentPropertyIterator {
return nil
}
// Insert inserts an IRI value at the specified index for a property "content".
// Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
func (this *ActivityStreamsContentProperty) InsertIRI(idx int, v *url.URL) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertRDFLangString inserts a langString value at the specified index for a
// property "content". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsContentProperty) InsertRDFLangString(idx int, v map[string]string) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
rdfLangStringMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertXMLSchemaString inserts a string value at the specified index for a
// property "content". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsContentProperty) InsertXMLSchemaString(idx int, v string) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
hasStringMember: true,
myIdx: idx,
parent: this,
xmlschemaStringMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsContentProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
for _, elem := range this.properties {
child := elem.JSONLDContext()
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API method specifically needed only for alternate implementations
// for go-fed. Applications should not use this method. Panics if the index is
// out of bounds.
func (this ActivityStreamsContentProperty) KindIndex(idx int) int {
return this.properties[idx].KindIndex()
}
// Len returns the number of values that exist for the "content" property.
func (this ActivityStreamsContentProperty) Len() (length int) {
return len(this.properties)
}
// Less computes whether another property is less than this one. Mixing types
// results in a consistent but arbitrary ordering
func (this ActivityStreamsContentProperty) Less(i, j int) bool {
idx1 := this.KindIndex(i)
idx2 := this.KindIndex(j)
if idx1 < idx2 {
return true
} else if idx1 == idx2 {
if idx1 == 0 {
lhs := this.properties[i].GetXMLSchemaString()
rhs := this.properties[j].GetXMLSchemaString()
return string1.LessString(lhs, rhs)
} else if idx1 == 1 {
lhs := this.properties[i].GetRDFLangString()
rhs := this.properties[j].GetRDFLangString()
return langstring.LessLangString(lhs, rhs)
} else if idx1 == -2 {
lhs := this.properties[i].GetIRI()
rhs := this.properties[j].GetIRI()
return lhs.String() < rhs.String()
}
}
return false
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsContentProperty) LessThan(o vocab.ActivityStreamsContentProperty) bool {
l1 := this.Len()
l2 := o.Len()
l := l1
if l2 < l1 {
l = l2
}
for i := 0; i < l; i++ {
if this.properties[i].LessThan(o.At(i)) {
return true
} else if o.At(i).LessThan(this.properties[i]) {
return false
}
}
return l1 < l2
}
// Name returns the name of this property ("content") with any alias.
func (this ActivityStreamsContentProperty) Name() string {
if this.Len() == 1 && this.At(0).IsRDFLangString() {
return "contentMap"
} else {
return "content"
}
}
// PrependIRI prepends an IRI value to the front of a list of the property
// "content".
func (this *ActivityStreamsContentProperty) PrependIRI(v *url.URL) {
this.properties = append([]*ActivityStreamsContentPropertyIterator{{
alias: this.alias,
iri: v,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependRDFLangString prepends a langString value to the front of a list of the
// property "content". Invalidates all iterators.
func (this *ActivityStreamsContentProperty) PrependRDFLangString(v map[string]string) {
this.properties = append([]*ActivityStreamsContentPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
rdfLangStringMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependXMLSchemaString prepends a string value to the front of a list of the
// property "content". Invalidates all iterators.
func (this *ActivityStreamsContentProperty) PrependXMLSchemaString(v string) {
this.properties = append([]*ActivityStreamsContentPropertyIterator{{
alias: this.alias,
hasStringMember: true,
myIdx: 0,
parent: this,
xmlschemaStringMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Remove deletes an element at the specified index from a list of the property
// "content", regardless of its type. Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsContentProperty) Remove(idx int) {
(this.properties)[idx].parent = nil
copy((this.properties)[idx:], (this.properties)[idx+1:])
(this.properties)[len(this.properties)-1] = &ActivityStreamsContentPropertyIterator{}
this.properties = (this.properties)[:len(this.properties)-1]
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsContentProperty) Serialize() (interface{}, error) {
s := make([]interface{}, 0, len(this.properties))
for _, iterator := range this.properties {
if b, err := iterator.serialize(); err != nil {
return s, err
} else {
s = append(s, b)
}
}
// Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example.
if len(s) == 1 {
return s[0], nil
}
return s, nil
}
// SetIRI sets an IRI value to be at the specified index for the property
// "content". Panics if the index is out of bounds.
func (this *ActivityStreamsContentProperty) SetIRI(idx int, v *url.URL) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
}
// SetRDFLangString sets a langString value to be at the specified index for the
// property "content". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsContentProperty) SetRDFLangString(idx int, v map[string]string) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
rdfLangStringMember: v,
}
}
// SetXMLSchemaString sets a string value to be at the specified index for the
// property "content". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsContentProperty) SetXMLSchemaString(idx int, v string) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsContentPropertyIterator{
alias: this.alias,
hasStringMember: true,
myIdx: idx,
parent: this,
xmlschemaStringMember: v,
}
}
// Swap swaps the location of values at two indices for the "content" property.
func (this ActivityStreamsContentProperty) Swap(i, j int) {
this.properties[i], this.properties[j] = this.properties[j], this.properties[i]
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertycontext contains the implementation for the context property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertycontext

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertycontext
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertycurrent contains the implementation for the current property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertycurrent

View File

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package propertycurrent
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,359 @@
// Code generated by astool. DO NOT EDIT.
package propertycurrent
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsCurrentProperty is the functional property "current". It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsCurrentProperty struct {
activitystreamsCollectionPageMember vocab.ActivityStreamsCollectionPage
activitystreamsLinkMember vocab.ActivityStreamsLink
activitystreamsMentionMember vocab.ActivityStreamsMention
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeCurrentProperty creates a "current" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeCurrentProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsCurrentProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "current"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "current")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsCurrentProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsCurrentProperty{
activitystreamsCollectionPageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeLinkActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsCurrentProperty{
activitystreamsLinkMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsCurrentProperty{
activitystreamsMentionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsCurrentProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsCurrentProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsCurrentProperty creates a new current property.
func NewActivityStreamsCurrentProperty() *ActivityStreamsCurrentProperty {
return &ActivityStreamsCurrentProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsCurrentProperty) Clear() {
this.activitystreamsCollectionPageMember = nil
this.activitystreamsLinkMember = nil
this.activitystreamsMentionMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsCollectionPage returns the value of this property. When
// IsActivityStreamsCollectionPage returns false,
// GetActivityStreamsCollectionPage will return an arbitrary value.
func (this ActivityStreamsCurrentProperty) GetActivityStreamsCollectionPage() vocab.ActivityStreamsCollectionPage {
return this.activitystreamsCollectionPageMember
}
// GetActivityStreamsLink returns the value of this property. When
// IsActivityStreamsLink returns false, GetActivityStreamsLink will return an
// arbitrary value.
func (this ActivityStreamsCurrentProperty) GetActivityStreamsLink() vocab.ActivityStreamsLink {
return this.activitystreamsLinkMember
}
// GetActivityStreamsMention returns the value of this property. When
// IsActivityStreamsMention returns false, GetActivityStreamsMention will
// return an arbitrary value.
func (this ActivityStreamsCurrentProperty) GetActivityStreamsMention() vocab.ActivityStreamsMention {
return this.activitystreamsMentionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsCurrentProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsCurrentProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsCurrentProperty) GetType() vocab.Type {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage()
}
if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink()
}
if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsCurrentProperty) HasAny() bool {
return this.IsActivityStreamsCollectionPage() ||
this.IsActivityStreamsLink() ||
this.IsActivityStreamsMention() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsCollectionPage returns true if this property has a type of
// "CollectionPage". When true, use the GetActivityStreamsCollectionPage and
// SetActivityStreamsCollectionPage methods to access and set this property.
func (this ActivityStreamsCurrentProperty) IsActivityStreamsCollectionPage() bool {
return this.activitystreamsCollectionPageMember != nil
}
// IsActivityStreamsLink returns true if this property has a type of "Link". When
// true, use the GetActivityStreamsLink and SetActivityStreamsLink methods to
// access and set this property.
func (this ActivityStreamsCurrentProperty) IsActivityStreamsLink() bool {
return this.activitystreamsLinkMember != nil
}
// IsActivityStreamsMention returns true if this property has a type of "Mention".
// When true, use the GetActivityStreamsMention and SetActivityStreamsMention
// methods to access and set this property.
func (this ActivityStreamsCurrentProperty) IsActivityStreamsMention() bool {
return this.activitystreamsMentionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsCurrentProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsCurrentProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsCurrentProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsCollectionPage() {
child = this.GetActivityStreamsCollectionPage().JSONLDContext()
} else if this.IsActivityStreamsLink() {
child = this.GetActivityStreamsLink().JSONLDContext()
} else if this.IsActivityStreamsMention() {
child = this.GetActivityStreamsMention().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsCurrentProperty) KindIndex() int {
if this.IsActivityStreamsCollectionPage() {
return 0
}
if this.IsActivityStreamsLink() {
return 1
}
if this.IsActivityStreamsMention() {
return 2
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 3
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsCurrentProperty) LessThan(o vocab.ActivityStreamsCurrentProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().LessThan(o.GetActivityStreamsCollectionPage())
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink())
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "current".
func (this ActivityStreamsCurrentProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "current"
} else {
return "current"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsCurrentProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().Serialize()
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().Serialize()
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsCollectionPage sets the value of this property. Calling
// IsActivityStreamsCollectionPage afterwards returns true.
func (this *ActivityStreamsCurrentProperty) SetActivityStreamsCollectionPage(v vocab.ActivityStreamsCollectionPage) {
this.Clear()
this.activitystreamsCollectionPageMember = v
}
// SetActivityStreamsLink sets the value of this property. Calling
// IsActivityStreamsLink afterwards returns true.
func (this *ActivityStreamsCurrentProperty) SetActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.Clear()
this.activitystreamsLinkMember = v
}
// SetActivityStreamsMention sets the value of this property. Calling
// IsActivityStreamsMention afterwards returns true.
func (this *ActivityStreamsCurrentProperty) SetActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.Clear()
this.activitystreamsMentionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsCurrentProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsCurrentProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsCurrentProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsCollectionPage); ok {
this.SetActivityStreamsCollectionPage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsLink); ok {
this.SetActivityStreamsLink(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsMention); ok {
this.SetActivityStreamsMention(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on current property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertydeleted contains the implementation for the deleted property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertydeleted

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertydeleted
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,204 @@
// Code generated by astool. DO NOT EDIT.
package propertydeleted
import (
"fmt"
datetime "github.com/go-fed/activity/streams/values/dateTime"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
"time"
)
// ActivityStreamsDeletedProperty is the functional property "deleted". It is
// permitted to be a single default-valued value type.
type ActivityStreamsDeletedProperty struct {
xmlschemaDateTimeMember time.Time
hasDateTimeMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeDeletedProperty creates a "deleted" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeDeletedProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsDeletedProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "deleted"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "deleted")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsDeletedProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := datetime.DeserializeDateTime(i); err == nil {
this := &ActivityStreamsDeletedProperty{
alias: alias,
hasDateTimeMember: true,
xmlschemaDateTimeMember: v,
}
return this, nil
}
this := &ActivityStreamsDeletedProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsDeletedProperty creates a new deleted property.
func NewActivityStreamsDeletedProperty() *ActivityStreamsDeletedProperty {
return &ActivityStreamsDeletedProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaDateTime
// afterwards will return false.
func (this *ActivityStreamsDeletedProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasDateTimeMember = false
}
// Get returns the value of this property. When IsXMLSchemaDateTime returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsDeletedProperty) Get() time.Time {
return this.xmlschemaDateTimeMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsDeletedProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsDeletedProperty) HasAny() bool {
return this.IsXMLSchemaDateTime() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsDeletedProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaDateTime returns true if this property is set and not an IRI.
func (this ActivityStreamsDeletedProperty) IsXMLSchemaDateTime() bool {
return this.hasDateTimeMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsDeletedProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsDeletedProperty) KindIndex() int {
if this.IsXMLSchemaDateTime() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsDeletedProperty) LessThan(o vocab.ActivityStreamsDeletedProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaDateTime() && !o.IsXMLSchemaDateTime() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaDateTime() && !o.IsXMLSchemaDateTime() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaDateTime() && o.IsXMLSchemaDateTime() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return datetime.LessDateTime(this.Get(), o.Get())
}
}
// Name returns the name of this property: "deleted".
func (this ActivityStreamsDeletedProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "deleted"
} else {
return "deleted"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsDeletedProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaDateTime() {
return datetime.SerializeDateTime(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaDateTime afterwards
// will return true.
func (this *ActivityStreamsDeletedProperty) Set(v time.Time) {
this.Clear()
this.xmlschemaDateTimeMember = v
this.hasDateTimeMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsDeletedProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertydescribes contains the implementation for the describes
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertydescribes

View File

@ -0,0 +1,257 @@
// Code generated by astool. DO NOT EDIT.
package propertydescribes
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyduration contains the implementation for the duration property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyduration

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyduration
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,204 @@
// Code generated by astool. DO NOT EDIT.
package propertyduration
import (
"fmt"
duration "github.com/go-fed/activity/streams/values/duration"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
"time"
)
// ActivityStreamsDurationProperty is the functional property "duration". It is
// permitted to be a single default-valued value type.
type ActivityStreamsDurationProperty struct {
xmlschemaDurationMember time.Duration
hasDurationMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeDurationProperty creates a "duration" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeDurationProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsDurationProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "duration"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "duration")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsDurationProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := duration.DeserializeDuration(i); err == nil {
this := &ActivityStreamsDurationProperty{
alias: alias,
hasDurationMember: true,
xmlschemaDurationMember: v,
}
return this, nil
}
this := &ActivityStreamsDurationProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsDurationProperty creates a new duration property.
func NewActivityStreamsDurationProperty() *ActivityStreamsDurationProperty {
return &ActivityStreamsDurationProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaDuration
// afterwards will return false.
func (this *ActivityStreamsDurationProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasDurationMember = false
}
// Get returns the value of this property. When IsXMLSchemaDuration returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsDurationProperty) Get() time.Duration {
return this.xmlschemaDurationMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsDurationProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsDurationProperty) HasAny() bool {
return this.IsXMLSchemaDuration() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsDurationProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaDuration returns true if this property is set and not an IRI.
func (this ActivityStreamsDurationProperty) IsXMLSchemaDuration() bool {
return this.hasDurationMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsDurationProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsDurationProperty) KindIndex() int {
if this.IsXMLSchemaDuration() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsDurationProperty) LessThan(o vocab.ActivityStreamsDurationProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaDuration() && !o.IsXMLSchemaDuration() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaDuration() && !o.IsXMLSchemaDuration() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaDuration() && o.IsXMLSchemaDuration() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return duration.LessDuration(this.Get(), o.Get())
}
}
// Name returns the name of this property: "duration".
func (this ActivityStreamsDurationProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "duration"
} else {
return "duration"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsDurationProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaDuration() {
return duration.SerializeDuration(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaDuration afterwards
// will return true.
func (this *ActivityStreamsDurationProperty) Set(v time.Duration) {
this.Clear()
this.xmlschemaDurationMember = v
this.hasDurationMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsDurationProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyendtime contains the implementation for the endTime property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyendtime

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyendtime
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,204 @@
// Code generated by astool. DO NOT EDIT.
package propertyendtime
import (
"fmt"
datetime "github.com/go-fed/activity/streams/values/dateTime"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
"time"
)
// ActivityStreamsEndTimeProperty is the functional property "endTime". It is
// permitted to be a single default-valued value type.
type ActivityStreamsEndTimeProperty struct {
xmlschemaDateTimeMember time.Time
hasDateTimeMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeEndTimeProperty creates a "endTime" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeEndTimeProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsEndTimeProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "endTime"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "endTime")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsEndTimeProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := datetime.DeserializeDateTime(i); err == nil {
this := &ActivityStreamsEndTimeProperty{
alias: alias,
hasDateTimeMember: true,
xmlschemaDateTimeMember: v,
}
return this, nil
}
this := &ActivityStreamsEndTimeProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsEndTimeProperty creates a new endTime property.
func NewActivityStreamsEndTimeProperty() *ActivityStreamsEndTimeProperty {
return &ActivityStreamsEndTimeProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaDateTime
// afterwards will return false.
func (this *ActivityStreamsEndTimeProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasDateTimeMember = false
}
// Get returns the value of this property. When IsXMLSchemaDateTime returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsEndTimeProperty) Get() time.Time {
return this.xmlschemaDateTimeMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsEndTimeProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsEndTimeProperty) HasAny() bool {
return this.IsXMLSchemaDateTime() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsEndTimeProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaDateTime returns true if this property is set and not an IRI.
func (this ActivityStreamsEndTimeProperty) IsXMLSchemaDateTime() bool {
return this.hasDateTimeMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsEndTimeProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsEndTimeProperty) KindIndex() int {
if this.IsXMLSchemaDateTime() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsEndTimeProperty) LessThan(o vocab.ActivityStreamsEndTimeProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaDateTime() && !o.IsXMLSchemaDateTime() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaDateTime() && !o.IsXMLSchemaDateTime() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaDateTime() && o.IsXMLSchemaDateTime() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return datetime.LessDateTime(this.Get(), o.Get())
}
}
// Name returns the name of this property: "endTime".
func (this ActivityStreamsEndTimeProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "endTime"
} else {
return "endTime"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsEndTimeProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaDateTime() {
return datetime.SerializeDateTime(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaDateTime afterwards
// will return true.
func (this *ActivityStreamsEndTimeProperty) Set(v time.Time) {
this.Clear()
this.xmlschemaDateTimeMember = v
this.hasDateTimeMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsEndTimeProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyfirst contains the implementation for the first property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyfirst

View File

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package propertyfirst
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,359 @@
// Code generated by astool. DO NOT EDIT.
package propertyfirst
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsFirstProperty is the functional property "first". It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsFirstProperty struct {
activitystreamsCollectionPageMember vocab.ActivityStreamsCollectionPage
activitystreamsLinkMember vocab.ActivityStreamsLink
activitystreamsMentionMember vocab.ActivityStreamsMention
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeFirstProperty creates a "first" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeFirstProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsFirstProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "first"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "first")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsFirstProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFirstProperty{
activitystreamsCollectionPageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeLinkActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFirstProperty{
activitystreamsLinkMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFirstProperty{
activitystreamsMentionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFirstProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsFirstProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsFirstProperty creates a new first property.
func NewActivityStreamsFirstProperty() *ActivityStreamsFirstProperty {
return &ActivityStreamsFirstProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsFirstProperty) Clear() {
this.activitystreamsCollectionPageMember = nil
this.activitystreamsLinkMember = nil
this.activitystreamsMentionMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsCollectionPage returns the value of this property. When
// IsActivityStreamsCollectionPage returns false,
// GetActivityStreamsCollectionPage will return an arbitrary value.
func (this ActivityStreamsFirstProperty) GetActivityStreamsCollectionPage() vocab.ActivityStreamsCollectionPage {
return this.activitystreamsCollectionPageMember
}
// GetActivityStreamsLink returns the value of this property. When
// IsActivityStreamsLink returns false, GetActivityStreamsLink will return an
// arbitrary value.
func (this ActivityStreamsFirstProperty) GetActivityStreamsLink() vocab.ActivityStreamsLink {
return this.activitystreamsLinkMember
}
// GetActivityStreamsMention returns the value of this property. When
// IsActivityStreamsMention returns false, GetActivityStreamsMention will
// return an arbitrary value.
func (this ActivityStreamsFirstProperty) GetActivityStreamsMention() vocab.ActivityStreamsMention {
return this.activitystreamsMentionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsFirstProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsFirstProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsFirstProperty) GetType() vocab.Type {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage()
}
if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink()
}
if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsFirstProperty) HasAny() bool {
return this.IsActivityStreamsCollectionPage() ||
this.IsActivityStreamsLink() ||
this.IsActivityStreamsMention() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsCollectionPage returns true if this property has a type of
// "CollectionPage". When true, use the GetActivityStreamsCollectionPage and
// SetActivityStreamsCollectionPage methods to access and set this property.
func (this ActivityStreamsFirstProperty) IsActivityStreamsCollectionPage() bool {
return this.activitystreamsCollectionPageMember != nil
}
// IsActivityStreamsLink returns true if this property has a type of "Link". When
// true, use the GetActivityStreamsLink and SetActivityStreamsLink methods to
// access and set this property.
func (this ActivityStreamsFirstProperty) IsActivityStreamsLink() bool {
return this.activitystreamsLinkMember != nil
}
// IsActivityStreamsMention returns true if this property has a type of "Mention".
// When true, use the GetActivityStreamsMention and SetActivityStreamsMention
// methods to access and set this property.
func (this ActivityStreamsFirstProperty) IsActivityStreamsMention() bool {
return this.activitystreamsMentionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsFirstProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsFirstProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsFirstProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsCollectionPage() {
child = this.GetActivityStreamsCollectionPage().JSONLDContext()
} else if this.IsActivityStreamsLink() {
child = this.GetActivityStreamsLink().JSONLDContext()
} else if this.IsActivityStreamsMention() {
child = this.GetActivityStreamsMention().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsFirstProperty) KindIndex() int {
if this.IsActivityStreamsCollectionPage() {
return 0
}
if this.IsActivityStreamsLink() {
return 1
}
if this.IsActivityStreamsMention() {
return 2
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 3
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsFirstProperty) LessThan(o vocab.ActivityStreamsFirstProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().LessThan(o.GetActivityStreamsCollectionPage())
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink())
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "first".
func (this ActivityStreamsFirstProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "first"
} else {
return "first"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsFirstProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().Serialize()
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().Serialize()
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsCollectionPage sets the value of this property. Calling
// IsActivityStreamsCollectionPage afterwards returns true.
func (this *ActivityStreamsFirstProperty) SetActivityStreamsCollectionPage(v vocab.ActivityStreamsCollectionPage) {
this.Clear()
this.activitystreamsCollectionPageMember = v
}
// SetActivityStreamsLink sets the value of this property. Calling
// IsActivityStreamsLink afterwards returns true.
func (this *ActivityStreamsFirstProperty) SetActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.Clear()
this.activitystreamsLinkMember = v
}
// SetActivityStreamsMention sets the value of this property. Calling
// IsActivityStreamsMention afterwards returns true.
func (this *ActivityStreamsFirstProperty) SetActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.Clear()
this.activitystreamsMentionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsFirstProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsFirstProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsFirstProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsCollectionPage); ok {
this.SetActivityStreamsCollectionPage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsLink); ok {
this.SetActivityStreamsLink(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsMention); ok {
this.SetActivityStreamsMention(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on first property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyfollowers contains the implementation for the followers
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyfollowers

View File

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package propertyfollowers
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,360 @@
// Code generated by astool. DO NOT EDIT.
package propertyfollowers
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsFollowersProperty is the functional property "followers". It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsFollowersProperty struct {
activitystreamsOrderedCollectionMember vocab.ActivityStreamsOrderedCollection
activitystreamsCollectionMember vocab.ActivityStreamsCollection
activitystreamsCollectionPageMember vocab.ActivityStreamsCollectionPage
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeFollowersProperty creates a "followers" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeFollowersProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsFollowersProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "followers"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "followers")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsFollowersProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeOrderedCollectionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowersProperty{
activitystreamsOrderedCollectionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeCollectionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowersProperty{
activitystreamsCollectionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowersProperty{
activitystreamsCollectionPageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowersProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsFollowersProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsFollowersProperty creates a new followers property.
func NewActivityStreamsFollowersProperty() *ActivityStreamsFollowersProperty {
return &ActivityStreamsFollowersProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsFollowersProperty) Clear() {
this.activitystreamsOrderedCollectionMember = nil
this.activitystreamsCollectionMember = nil
this.activitystreamsCollectionPageMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsCollection returns the value of this property. When
// IsActivityStreamsCollection returns false, GetActivityStreamsCollection
// will return an arbitrary value.
func (this ActivityStreamsFollowersProperty) GetActivityStreamsCollection() vocab.ActivityStreamsCollection {
return this.activitystreamsCollectionMember
}
// GetActivityStreamsCollectionPage returns the value of this property. When
// IsActivityStreamsCollectionPage returns false,
// GetActivityStreamsCollectionPage will return an arbitrary value.
func (this ActivityStreamsFollowersProperty) GetActivityStreamsCollectionPage() vocab.ActivityStreamsCollectionPage {
return this.activitystreamsCollectionPageMember
}
// GetActivityStreamsOrderedCollection returns the value of this property. When
// IsActivityStreamsOrderedCollection returns false,
// GetActivityStreamsOrderedCollection will return an arbitrary value.
func (this ActivityStreamsFollowersProperty) GetActivityStreamsOrderedCollection() vocab.ActivityStreamsOrderedCollection {
return this.activitystreamsOrderedCollectionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsFollowersProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsFollowersProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsFollowersProperty) GetType() vocab.Type {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection()
}
if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection()
}
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsFollowersProperty) HasAny() bool {
return this.IsActivityStreamsOrderedCollection() ||
this.IsActivityStreamsCollection() ||
this.IsActivityStreamsCollectionPage() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsCollection returns true if this property has a type of
// "Collection". When true, use the GetActivityStreamsCollection and
// SetActivityStreamsCollection methods to access and set this property.
func (this ActivityStreamsFollowersProperty) IsActivityStreamsCollection() bool {
return this.activitystreamsCollectionMember != nil
}
// IsActivityStreamsCollectionPage returns true if this property has a type of
// "CollectionPage". When true, use the GetActivityStreamsCollectionPage and
// SetActivityStreamsCollectionPage methods to access and set this property.
func (this ActivityStreamsFollowersProperty) IsActivityStreamsCollectionPage() bool {
return this.activitystreamsCollectionPageMember != nil
}
// IsActivityStreamsOrderedCollection returns true if this property has a type of
// "OrderedCollection". When true, use the GetActivityStreamsOrderedCollection
// and SetActivityStreamsOrderedCollection methods to access and set this
// property.
func (this ActivityStreamsFollowersProperty) IsActivityStreamsOrderedCollection() bool {
return this.activitystreamsOrderedCollectionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsFollowersProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsFollowersProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsFollowersProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsOrderedCollection() {
child = this.GetActivityStreamsOrderedCollection().JSONLDContext()
} else if this.IsActivityStreamsCollection() {
child = this.GetActivityStreamsCollection().JSONLDContext()
} else if this.IsActivityStreamsCollectionPage() {
child = this.GetActivityStreamsCollectionPage().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsFollowersProperty) KindIndex() int {
if this.IsActivityStreamsOrderedCollection() {
return 0
}
if this.IsActivityStreamsCollection() {
return 1
}
if this.IsActivityStreamsCollectionPage() {
return 2
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 3
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsFollowersProperty) LessThan(o vocab.ActivityStreamsFollowersProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().LessThan(o.GetActivityStreamsOrderedCollection())
} else if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection().LessThan(o.GetActivityStreamsCollection())
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().LessThan(o.GetActivityStreamsCollectionPage())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "followers".
func (this ActivityStreamsFollowersProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "followers"
} else {
return "followers"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsFollowersProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().Serialize()
} else if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection().Serialize()
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsCollection sets the value of this property. Calling
// IsActivityStreamsCollection afterwards returns true.
func (this *ActivityStreamsFollowersProperty) SetActivityStreamsCollection(v vocab.ActivityStreamsCollection) {
this.Clear()
this.activitystreamsCollectionMember = v
}
// SetActivityStreamsCollectionPage sets the value of this property. Calling
// IsActivityStreamsCollectionPage afterwards returns true.
func (this *ActivityStreamsFollowersProperty) SetActivityStreamsCollectionPage(v vocab.ActivityStreamsCollectionPage) {
this.Clear()
this.activitystreamsCollectionPageMember = v
}
// SetActivityStreamsOrderedCollection sets the value of this property. Calling
// IsActivityStreamsOrderedCollection afterwards returns true.
func (this *ActivityStreamsFollowersProperty) SetActivityStreamsOrderedCollection(v vocab.ActivityStreamsOrderedCollection) {
this.Clear()
this.activitystreamsOrderedCollectionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsFollowersProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsFollowersProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsFollowersProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsOrderedCollection); ok {
this.SetActivityStreamsOrderedCollection(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsCollection); ok {
this.SetActivityStreamsCollection(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsCollectionPage); ok {
this.SetActivityStreamsCollectionPage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on followers property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyfollowing contains the implementation for the following
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyfollowing

View File

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package propertyfollowing
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,360 @@
// Code generated by astool. DO NOT EDIT.
package propertyfollowing
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsFollowingProperty is the functional property "following". It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsFollowingProperty struct {
activitystreamsOrderedCollectionMember vocab.ActivityStreamsOrderedCollection
activitystreamsCollectionMember vocab.ActivityStreamsCollection
activitystreamsCollectionPageMember vocab.ActivityStreamsCollectionPage
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeFollowingProperty creates a "following" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeFollowingProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsFollowingProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "following"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "following")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsFollowingProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeOrderedCollectionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowingProperty{
activitystreamsOrderedCollectionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeCollectionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowingProperty{
activitystreamsCollectionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowingProperty{
activitystreamsCollectionPageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsFollowingProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsFollowingProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsFollowingProperty creates a new following property.
func NewActivityStreamsFollowingProperty() *ActivityStreamsFollowingProperty {
return &ActivityStreamsFollowingProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsFollowingProperty) Clear() {
this.activitystreamsOrderedCollectionMember = nil
this.activitystreamsCollectionMember = nil
this.activitystreamsCollectionPageMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsCollection returns the value of this property. When
// IsActivityStreamsCollection returns false, GetActivityStreamsCollection
// will return an arbitrary value.
func (this ActivityStreamsFollowingProperty) GetActivityStreamsCollection() vocab.ActivityStreamsCollection {
return this.activitystreamsCollectionMember
}
// GetActivityStreamsCollectionPage returns the value of this property. When
// IsActivityStreamsCollectionPage returns false,
// GetActivityStreamsCollectionPage will return an arbitrary value.
func (this ActivityStreamsFollowingProperty) GetActivityStreamsCollectionPage() vocab.ActivityStreamsCollectionPage {
return this.activitystreamsCollectionPageMember
}
// GetActivityStreamsOrderedCollection returns the value of this property. When
// IsActivityStreamsOrderedCollection returns false,
// GetActivityStreamsOrderedCollection will return an arbitrary value.
func (this ActivityStreamsFollowingProperty) GetActivityStreamsOrderedCollection() vocab.ActivityStreamsOrderedCollection {
return this.activitystreamsOrderedCollectionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsFollowingProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsFollowingProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsFollowingProperty) GetType() vocab.Type {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection()
}
if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection()
}
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsFollowingProperty) HasAny() bool {
return this.IsActivityStreamsOrderedCollection() ||
this.IsActivityStreamsCollection() ||
this.IsActivityStreamsCollectionPage() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsCollection returns true if this property has a type of
// "Collection". When true, use the GetActivityStreamsCollection and
// SetActivityStreamsCollection methods to access and set this property.
func (this ActivityStreamsFollowingProperty) IsActivityStreamsCollection() bool {
return this.activitystreamsCollectionMember != nil
}
// IsActivityStreamsCollectionPage returns true if this property has a type of
// "CollectionPage". When true, use the GetActivityStreamsCollectionPage and
// SetActivityStreamsCollectionPage methods to access and set this property.
func (this ActivityStreamsFollowingProperty) IsActivityStreamsCollectionPage() bool {
return this.activitystreamsCollectionPageMember != nil
}
// IsActivityStreamsOrderedCollection returns true if this property has a type of
// "OrderedCollection". When true, use the GetActivityStreamsOrderedCollection
// and SetActivityStreamsOrderedCollection methods to access and set this
// property.
func (this ActivityStreamsFollowingProperty) IsActivityStreamsOrderedCollection() bool {
return this.activitystreamsOrderedCollectionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsFollowingProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsFollowingProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsFollowingProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsOrderedCollection() {
child = this.GetActivityStreamsOrderedCollection().JSONLDContext()
} else if this.IsActivityStreamsCollection() {
child = this.GetActivityStreamsCollection().JSONLDContext()
} else if this.IsActivityStreamsCollectionPage() {
child = this.GetActivityStreamsCollectionPage().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsFollowingProperty) KindIndex() int {
if this.IsActivityStreamsOrderedCollection() {
return 0
}
if this.IsActivityStreamsCollection() {
return 1
}
if this.IsActivityStreamsCollectionPage() {
return 2
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 3
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsFollowingProperty) LessThan(o vocab.ActivityStreamsFollowingProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().LessThan(o.GetActivityStreamsOrderedCollection())
} else if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection().LessThan(o.GetActivityStreamsCollection())
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().LessThan(o.GetActivityStreamsCollectionPage())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "following".
func (this ActivityStreamsFollowingProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "following"
} else {
return "following"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsFollowingProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().Serialize()
} else if this.IsActivityStreamsCollection() {
return this.GetActivityStreamsCollection().Serialize()
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsCollection sets the value of this property. Calling
// IsActivityStreamsCollection afterwards returns true.
func (this *ActivityStreamsFollowingProperty) SetActivityStreamsCollection(v vocab.ActivityStreamsCollection) {
this.Clear()
this.activitystreamsCollectionMember = v
}
// SetActivityStreamsCollectionPage sets the value of this property. Calling
// IsActivityStreamsCollectionPage afterwards returns true.
func (this *ActivityStreamsFollowingProperty) SetActivityStreamsCollectionPage(v vocab.ActivityStreamsCollectionPage) {
this.Clear()
this.activitystreamsCollectionPageMember = v
}
// SetActivityStreamsOrderedCollection sets the value of this property. Calling
// IsActivityStreamsOrderedCollection afterwards returns true.
func (this *ActivityStreamsFollowingProperty) SetActivityStreamsOrderedCollection(v vocab.ActivityStreamsOrderedCollection) {
this.Clear()
this.activitystreamsOrderedCollectionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsFollowingProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsFollowingProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsFollowingProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsOrderedCollection); ok {
this.SetActivityStreamsOrderedCollection(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsCollection); ok {
this.SetActivityStreamsCollection(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsCollectionPage); ok {
this.SetActivityStreamsCollectionPage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on following property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyformertype contains the implementation for the formerType
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyformertype

View File

@ -0,0 +1,257 @@
// Code generated by astool. DO NOT EDIT.
package propertyformertype
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertygenerator contains the implementation for the generator
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertygenerator

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertygenerator
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyheight contains the implementation for the height property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyheight

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyheight
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,204 @@
// Code generated by astool. DO NOT EDIT.
package propertyheight
import (
"fmt"
nonnegativeinteger "github.com/go-fed/activity/streams/values/nonNegativeInteger"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsHeightProperty is the functional property "height". It is
// permitted to be a single default-valued value type.
type ActivityStreamsHeightProperty struct {
xmlschemaNonNegativeIntegerMember int
hasNonNegativeIntegerMember bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeHeightProperty creates a "height" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeHeightProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsHeightProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "height"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "height")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsHeightProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := nonnegativeinteger.DeserializeNonNegativeInteger(i); err == nil {
this := &ActivityStreamsHeightProperty{
alias: alias,
hasNonNegativeIntegerMember: true,
xmlschemaNonNegativeIntegerMember: v,
}
return this, nil
}
this := &ActivityStreamsHeightProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsHeightProperty creates a new height property.
func NewActivityStreamsHeightProperty() *ActivityStreamsHeightProperty {
return &ActivityStreamsHeightProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling
// IsXMLSchemaNonNegativeInteger afterwards will return false.
func (this *ActivityStreamsHeightProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasNonNegativeIntegerMember = false
}
// Get returns the value of this property. When IsXMLSchemaNonNegativeInteger
// returns false, Get will return any arbitrary value.
func (this ActivityStreamsHeightProperty) Get() int {
return this.xmlschemaNonNegativeIntegerMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsHeightProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsHeightProperty) HasAny() bool {
return this.IsXMLSchemaNonNegativeInteger() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsHeightProperty) IsIRI() bool {
return this.iri != nil
}
// IsXMLSchemaNonNegativeInteger returns true if this property is set and not an
// IRI.
func (this ActivityStreamsHeightProperty) IsXMLSchemaNonNegativeInteger() bool {
return this.hasNonNegativeIntegerMember
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsHeightProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsHeightProperty) KindIndex() int {
if this.IsXMLSchemaNonNegativeInteger() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsHeightProperty) LessThan(o vocab.ActivityStreamsHeightProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaNonNegativeInteger() && o.IsXMLSchemaNonNegativeInteger() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return nonnegativeinteger.LessNonNegativeInteger(this.Get(), o.Get())
}
}
// Name returns the name of this property: "height".
func (this ActivityStreamsHeightProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "height"
} else {
return "height"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsHeightProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaNonNegativeInteger() {
return nonnegativeinteger.SerializeNonNegativeInteger(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaNonNegativeInteger
// afterwards will return true.
func (this *ActivityStreamsHeightProperty) Set(v int) {
this.Clear()
this.xmlschemaNonNegativeIntegerMember = v
this.hasNonNegativeIntegerMember = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsHeightProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyhref contains the implementation for the href property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyhref

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyhref
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,181 @@
// Code generated by astool. DO NOT EDIT.
package propertyhref
import (
"fmt"
anyuri "github.com/go-fed/activity/streams/values/anyURI"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsHrefProperty is the functional property "href". It is permitted
// to be a single nilable value type.
type ActivityStreamsHrefProperty struct {
xmlschemaAnyURIMember *url.URL
unknown interface{}
alias string
}
// DeserializeHrefProperty creates a "href" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeHrefProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsHrefProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "href"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "href")
}
i, ok := m[propName]
if ok {
if v, err := anyuri.DeserializeAnyURI(i); err == nil {
this := &ActivityStreamsHrefProperty{
alias: alias,
xmlschemaAnyURIMember: v,
}
return this, nil
}
this := &ActivityStreamsHrefProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsHrefProperty creates a new href property.
func NewActivityStreamsHrefProperty() *ActivityStreamsHrefProperty {
return &ActivityStreamsHrefProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsXMLSchemaAnyURI
// afterwards will return false.
func (this *ActivityStreamsHrefProperty) Clear() {
this.unknown = nil
this.xmlschemaAnyURIMember = nil
}
// Get returns the value of this property. When IsXMLSchemaAnyURI returns false,
// Get will return any arbitrary value.
func (this ActivityStreamsHrefProperty) Get() *url.URL {
return this.xmlschemaAnyURIMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsHrefProperty) GetIRI() *url.URL {
return this.xmlschemaAnyURIMember
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsHrefProperty) HasAny() bool {
return this.IsXMLSchemaAnyURI()
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsHrefProperty) IsIRI() bool {
return this.xmlschemaAnyURIMember != nil
}
// IsXMLSchemaAnyURI returns true if this property is set and not an IRI.
func (this ActivityStreamsHrefProperty) IsXMLSchemaAnyURI() bool {
return this.xmlschemaAnyURIMember != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsHrefProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsHrefProperty) KindIndex() int {
if this.IsXMLSchemaAnyURI() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsHrefProperty) LessThan(o vocab.ActivityStreamsHrefProperty) bool {
if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() {
// Both are unknowns.
return false
} else if this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() {
// Values are always greater than unknown values.
return false
} else if !this.IsXMLSchemaAnyURI() && o.IsXMLSchemaAnyURI() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return anyuri.LessAnyURI(this.Get(), o.Get())
}
}
// Name returns the name of this property: "href".
func (this ActivityStreamsHrefProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "href"
} else {
return "href"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsHrefProperty) Serialize() (interface{}, error) {
if this.IsXMLSchemaAnyURI() {
return anyuri.SerializeAnyURI(this.Get())
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsXMLSchemaAnyURI afterwards will
// return true.
func (this *ActivityStreamsHrefProperty) Set(v *url.URL) {
this.Clear()
this.xmlschemaAnyURIMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsHrefProperty) SetIRI(v *url.URL) {
this.Clear()
this.Set(v)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyhreflang contains the implementation for the hreflang property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyhreflang

View File

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package propertyhreflang
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface{}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,203 @@
// Code generated by astool. DO NOT EDIT.
package propertyhreflang
import (
"fmt"
bcp47 "github.com/go-fed/activity/streams/values/bcp47"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsHreflangProperty is the functional property "hreflang". It is
// permitted to be a single default-valued value type.
type ActivityStreamsHreflangProperty struct {
rfcBcp47Member string
hasBcp47Member bool
unknown interface{}
iri *url.URL
alias string
}
// DeserializeHreflangProperty creates a "hreflang" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeHreflangProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsHreflangProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "hreflang"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "hreflang")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsHreflangProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if v, err := bcp47.DeserializeBcp47(i); err == nil {
this := &ActivityStreamsHreflangProperty{
alias: alias,
hasBcp47Member: true,
rfcBcp47Member: v,
}
return this, nil
}
this := &ActivityStreamsHreflangProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsHreflangProperty creates a new hreflang property.
func NewActivityStreamsHreflangProperty() *ActivityStreamsHreflangProperty {
return &ActivityStreamsHreflangProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling IsRFCBcp47 afterwards
// will return false.
func (this *ActivityStreamsHreflangProperty) Clear() {
this.unknown = nil
this.iri = nil
this.hasBcp47Member = false
}
// Get returns the value of this property. When IsRFCBcp47 returns false, Get will
// return any arbitrary value.
func (this ActivityStreamsHreflangProperty) Get() string {
return this.rfcBcp47Member
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return any arbitrary value.
func (this ActivityStreamsHreflangProperty) GetIRI() *url.URL {
return this.iri
}
// HasAny returns true if the value or IRI is set.
func (this ActivityStreamsHreflangProperty) HasAny() bool {
return this.IsRFCBcp47() || this.iri != nil
}
// IsIRI returns true if this property is an IRI.
func (this ActivityStreamsHreflangProperty) IsIRI() bool {
return this.iri != nil
}
// IsRFCBcp47 returns true if this property is set and not an IRI.
func (this ActivityStreamsHreflangProperty) IsRFCBcp47() bool {
return this.hasBcp47Member
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsHreflangProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsHreflangProperty) KindIndex() int {
if this.IsRFCBcp47() {
return 0
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsHreflangProperty) LessThan(o vocab.ActivityStreamsHreflangProperty) bool {
// LessThan comparison for if either or both are IRIs.
if this.IsIRI() && o.IsIRI() {
return this.iri.String() < o.GetIRI().String()
} else if this.IsIRI() {
// IRIs are always less than other values, none, or unknowns
return true
} else if o.IsIRI() {
// This other, none, or unknown value is always greater than IRIs
return false
}
// LessThan comparison for the single value or unknown value.
if !this.IsRFCBcp47() && !o.IsRFCBcp47() {
// Both are unknowns.
return false
} else if this.IsRFCBcp47() && !o.IsRFCBcp47() {
// Values are always greater than unknown values.
return false
} else if !this.IsRFCBcp47() && o.IsRFCBcp47() {
// Unknowns are always less than known values.
return true
} else {
// Actual comparison.
return bcp47.LessBcp47(this.Get(), o.Get())
}
}
// Name returns the name of this property: "hreflang".
func (this ActivityStreamsHreflangProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "hreflang"
} else {
return "hreflang"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsHreflangProperty) Serialize() (interface{}, error) {
if this.IsRFCBcp47() {
return bcp47.SerializeBcp47(this.Get())
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// Set sets the value of this property. Calling IsRFCBcp47 afterwards will return
// true.
func (this *ActivityStreamsHreflangProperty) Set(v string) {
this.Clear()
this.rfcBcp47Member = v
this.hasBcp47Member = true
}
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
// true.
func (this *ActivityStreamsHreflangProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyicon contains the implementation for the icon property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyicon

View File

@ -0,0 +1,30 @@
// Code generated by astool. DO NOT EDIT.
package propertyicon
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,824 @@
// Code generated by astool. DO NOT EDIT.
package propertyicon
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsIconPropertyIterator is an iterator for a property. It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsIconPropertyIterator struct {
activitystreamsImageMember vocab.ActivityStreamsImage
activitystreamsLinkMember vocab.ActivityStreamsLink
activitystreamsMentionMember vocab.ActivityStreamsMention
unknown interface{}
iri *url.URL
alias string
myIdx int
parent vocab.ActivityStreamsIconProperty
}
// NewActivityStreamsIconPropertyIterator creates a new ActivityStreamsIcon
// property.
func NewActivityStreamsIconPropertyIterator() *ActivityStreamsIconPropertyIterator {
return &ActivityStreamsIconPropertyIterator{alias: ""}
}
// deserializeActivityStreamsIconPropertyIterator creates an iterator from an
// element that has been unmarshalled from a text or binary format.
func deserializeActivityStreamsIconPropertyIterator(i interface{}, aliasMap map[string]string) (*ActivityStreamsIconPropertyIterator, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsIconPropertyIterator{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeImageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsIconPropertyIterator{
activitystreamsImageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeLinkActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsIconPropertyIterator{
activitystreamsLinkMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsIconPropertyIterator{
activitystreamsMentionMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsIconPropertyIterator{
alias: alias,
unknown: i,
}
return this, nil
}
// GetActivityStreamsImage returns the value of this property. When
// IsActivityStreamsImage returns false, GetActivityStreamsImage will return
// an arbitrary value.
func (this ActivityStreamsIconPropertyIterator) GetActivityStreamsImage() vocab.ActivityStreamsImage {
return this.activitystreamsImageMember
}
// GetActivityStreamsLink returns the value of this property. When
// IsActivityStreamsLink returns false, GetActivityStreamsLink will return an
// arbitrary value.
func (this ActivityStreamsIconPropertyIterator) GetActivityStreamsLink() vocab.ActivityStreamsLink {
return this.activitystreamsLinkMember
}
// GetActivityStreamsMention returns the value of this property. When
// IsActivityStreamsMention returns false, GetActivityStreamsMention will
// return an arbitrary value.
func (this ActivityStreamsIconPropertyIterator) GetActivityStreamsMention() vocab.ActivityStreamsMention {
return this.activitystreamsMentionMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsIconPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsIconPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage()
}
if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink()
}
if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsIconPropertyIterator) HasAny() bool {
return this.IsActivityStreamsImage() ||
this.IsActivityStreamsLink() ||
this.IsActivityStreamsMention() ||
this.iri != nil
}
// IsActivityStreamsImage returns true if this property has a type of "Image".
// When true, use the GetActivityStreamsImage and SetActivityStreamsImage
// methods to access and set this property.
func (this ActivityStreamsIconPropertyIterator) IsActivityStreamsImage() bool {
return this.activitystreamsImageMember != nil
}
// IsActivityStreamsLink returns true if this property has a type of "Link". When
// true, use the GetActivityStreamsLink and SetActivityStreamsLink methods to
// access and set this property.
func (this ActivityStreamsIconPropertyIterator) IsActivityStreamsLink() bool {
return this.activitystreamsLinkMember != nil
}
// IsActivityStreamsMention returns true if this property has a type of "Mention".
// When true, use the GetActivityStreamsMention and SetActivityStreamsMention
// methods to access and set this property.
func (this ActivityStreamsIconPropertyIterator) IsActivityStreamsMention() bool {
return this.activitystreamsMentionMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsIconPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsIconPropertyIterator) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsImage() {
child = this.GetActivityStreamsImage().JSONLDContext()
} else if this.IsActivityStreamsLink() {
child = this.GetActivityStreamsLink().JSONLDContext()
} else if this.IsActivityStreamsMention() {
child = this.GetActivityStreamsMention().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsIconPropertyIterator) KindIndex() int {
if this.IsActivityStreamsImage() {
return 0
}
if this.IsActivityStreamsLink() {
return 1
}
if this.IsActivityStreamsMention() {
return 2
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsIconPropertyIterator) LessThan(o vocab.ActivityStreamsIconPropertyIterator) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage().LessThan(o.GetActivityStreamsImage())
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink())
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "ActivityStreamsIcon".
func (this ActivityStreamsIconPropertyIterator) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "ActivityStreamsIcon"
} else {
return "ActivityStreamsIcon"
}
}
// Next returns the next iterator, or nil if there is no next iterator.
func (this ActivityStreamsIconPropertyIterator) Next() vocab.ActivityStreamsIconPropertyIterator {
if this.myIdx+1 >= this.parent.Len() {
return nil
} else {
return this.parent.At(this.myIdx + 1)
}
}
// Prev returns the previous iterator, or nil if there is no previous iterator.
func (this ActivityStreamsIconPropertyIterator) Prev() vocab.ActivityStreamsIconPropertyIterator {
if this.myIdx-1 < 0 {
return nil
} else {
return this.parent.At(this.myIdx - 1)
}
}
// SetActivityStreamsImage sets the value of this property. Calling
// IsActivityStreamsImage afterwards returns true.
func (this *ActivityStreamsIconPropertyIterator) SetActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.clear()
this.activitystreamsImageMember = v
}
// SetActivityStreamsLink sets the value of this property. Calling
// IsActivityStreamsLink afterwards returns true.
func (this *ActivityStreamsIconPropertyIterator) SetActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.clear()
this.activitystreamsLinkMember = v
}
// SetActivityStreamsMention sets the value of this property. Calling
// IsActivityStreamsMention afterwards returns true.
func (this *ActivityStreamsIconPropertyIterator) SetActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.clear()
this.activitystreamsMentionMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsIconPropertyIterator) SetIRI(v *url.URL) {
this.clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsIconPropertyIterator) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsImage); ok {
this.SetActivityStreamsImage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsLink); ok {
this.SetActivityStreamsLink(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsMention); ok {
this.SetActivityStreamsMention(v)
return nil
}
return fmt.Errorf("illegal type to set on ActivityStreamsIcon property: %T", t)
}
// clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsIconPropertyIterator) clear() {
this.activitystreamsImageMember = nil
this.activitystreamsLinkMember = nil
this.activitystreamsMentionMember = nil
this.unknown = nil
this.iri = nil
}
// serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsIconPropertyIterator) serialize() (interface{}, error) {
if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage().Serialize()
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().Serialize()
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// ActivityStreamsIconProperty is the non-functional property "icon". It is
// permitted to have one or more values, and of different value types.
type ActivityStreamsIconProperty struct {
properties []*ActivityStreamsIconPropertyIterator
alias string
}
// DeserializeIconProperty creates a "icon" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeIconProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsIconProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "icon"
if len(alias) > 0 {
propName = fmt.Sprintf("%s:%s", alias, "icon")
}
i, ok := m[propName]
if ok {
this := &ActivityStreamsIconProperty{
alias: alias,
properties: []*ActivityStreamsIconPropertyIterator{},
}
if list, ok := i.([]interface{}); ok {
for _, iterator := range list {
if p, err := deserializeActivityStreamsIconPropertyIterator(iterator, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
} else {
if p, err := deserializeActivityStreamsIconPropertyIterator(i, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
// Set up the properties for iteration.
for idx, ele := range this.properties {
ele.parent = this
ele.myIdx = idx
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsIconProperty creates a new icon property.
func NewActivityStreamsIconProperty() *ActivityStreamsIconProperty {
return &ActivityStreamsIconProperty{alias: ""}
}
// AppendActivityStreamsImage appends a Image value to the back of a list of the
// property "icon". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsIconProperty) AppendActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.properties = append(this.properties, &ActivityStreamsIconPropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendActivityStreamsLink appends a Link value to the back of a list of the
// property "icon". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsIconProperty) AppendActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.properties = append(this.properties, &ActivityStreamsIconPropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendActivityStreamsMention appends a Mention value to the back of a list of
// the property "icon". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsIconProperty) AppendActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.properties = append(this.properties, &ActivityStreamsIconPropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendIRI appends an IRI value to the back of a list of the property "icon"
func (this *ActivityStreamsIconProperty) AppendIRI(v *url.URL) {
this.properties = append(this.properties, &ActivityStreamsIconPropertyIterator{
alias: this.alias,
iri: v,
myIdx: this.Len(),
parent: this,
})
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "icon". Invalidates iterators that are traversing using Prev.
// Returns an error if the type is not a valid one to set for this property.
func (this *ActivityStreamsIconProperty) AppendType(t vocab.Type) error {
n := &ActivityStreamsIconPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append(this.properties, n)
return nil
}
// At returns the property value for the specified index. Panics if the index is
// out of bounds.
func (this ActivityStreamsIconProperty) At(index int) vocab.ActivityStreamsIconPropertyIterator {
return this.properties[index]
}
// Begin returns the first iterator, or nil if empty. Can be used with the
// iterator's Next method and this property's End method to iterate from front
// to back through all values.
func (this ActivityStreamsIconProperty) Begin() vocab.ActivityStreamsIconPropertyIterator {
if this.Empty() {
return nil
} else {
return this.properties[0]
}
}
// Empty returns returns true if there are no elements.
func (this ActivityStreamsIconProperty) Empty() bool {
return this.Len() == 0
}
// End returns beyond-the-last iterator, which is nil. Can be used with the
// iterator's Next method and this property's Begin method to iterate from
// front to back through all values.
func (this ActivityStreamsIconProperty) End() vocab.ActivityStreamsIconPropertyIterator {
return nil
}
// InsertActivityStreamsImage inserts a Image value at the specified index for a
// property "icon". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsIconProperty) InsertActivityStreamsImage(idx int, v vocab.ActivityStreamsImage) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertActivityStreamsLink inserts a Link value at the specified index for a
// property "icon". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsIconProperty) InsertActivityStreamsLink(idx int, v vocab.ActivityStreamsLink) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertActivityStreamsMention inserts a Mention value at the specified index for
// a property "icon". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsIconProperty) InsertActivityStreamsMention(idx int, v vocab.ActivityStreamsMention) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Insert inserts an IRI value at the specified index for a property "icon".
// Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
func (this *ActivityStreamsIconProperty) InsertIRI(idx int, v *url.URL) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsIconPropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "icon". Invalidates all iterators. Returns an error if the type is
// not a valid one to set for this property.
func (this *ActivityStreamsIconProperty) InsertType(idx int, t vocab.Type) error {
n := &ActivityStreamsIconPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = n
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
return nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsIconProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
for _, elem := range this.properties {
child := elem.JSONLDContext()
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API method specifically needed only for alternate implementations
// for go-fed. Applications should not use this method. Panics if the index is
// out of bounds.
func (this ActivityStreamsIconProperty) KindIndex(idx int) int {
return this.properties[idx].KindIndex()
}
// Len returns the number of values that exist for the "icon" property.
func (this ActivityStreamsIconProperty) Len() (length int) {
return len(this.properties)
}
// Less computes whether another property is less than this one. Mixing types
// results in a consistent but arbitrary ordering
func (this ActivityStreamsIconProperty) Less(i, j int) bool {
idx1 := this.KindIndex(i)
idx2 := this.KindIndex(j)
if idx1 < idx2 {
return true
} else if idx1 == idx2 {
if idx1 == 0 {
lhs := this.properties[i].GetActivityStreamsImage()
rhs := this.properties[j].GetActivityStreamsImage()
return lhs.LessThan(rhs)
} else if idx1 == 1 {
lhs := this.properties[i].GetActivityStreamsLink()
rhs := this.properties[j].GetActivityStreamsLink()
return lhs.LessThan(rhs)
} else if idx1 == 2 {
lhs := this.properties[i].GetActivityStreamsMention()
rhs := this.properties[j].GetActivityStreamsMention()
return lhs.LessThan(rhs)
} else if idx1 == -2 {
lhs := this.properties[i].GetIRI()
rhs := this.properties[j].GetIRI()
return lhs.String() < rhs.String()
}
}
return false
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsIconProperty) LessThan(o vocab.ActivityStreamsIconProperty) bool {
l1 := this.Len()
l2 := o.Len()
l := l1
if l2 < l1 {
l = l2
}
for i := 0; i < l; i++ {
if this.properties[i].LessThan(o.At(i)) {
return true
} else if o.At(i).LessThan(this.properties[i]) {
return false
}
}
return l1 < l2
}
// Name returns the name of this property ("icon") with any alias.
func (this ActivityStreamsIconProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "icon"
} else {
return "icon"
}
}
// PrependActivityStreamsImage prepends a Image value to the front of a list of
// the property "icon". Invalidates all iterators.
func (this *ActivityStreamsIconProperty) PrependActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.properties = append([]*ActivityStreamsIconPropertyIterator{{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependActivityStreamsLink prepends a Link value to the front of a list of the
// property "icon". Invalidates all iterators.
func (this *ActivityStreamsIconProperty) PrependActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.properties = append([]*ActivityStreamsIconPropertyIterator{{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependActivityStreamsMention prepends a Mention value to the front of a list
// of the property "icon". Invalidates all iterators.
func (this *ActivityStreamsIconProperty) PrependActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.properties = append([]*ActivityStreamsIconPropertyIterator{{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependIRI prepends an IRI value to the front of a list of the property "icon".
func (this *ActivityStreamsIconProperty) PrependIRI(v *url.URL) {
this.properties = append([]*ActivityStreamsIconPropertyIterator{{
alias: this.alias,
iri: v,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "icon". Invalidates all iterators. Returns an error if the type is
// not a valid one to set for this property.
func (this *ActivityStreamsIconProperty) PrependType(t vocab.Type) error {
n := &ActivityStreamsIconPropertyIterator{
alias: this.alias,
myIdx: 0,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append([]*ActivityStreamsIconPropertyIterator{n}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
return nil
}
// Remove deletes an element at the specified index from a list of the property
// "icon", regardless of its type. Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsIconProperty) Remove(idx int) {
(this.properties)[idx].parent = nil
copy((this.properties)[idx:], (this.properties)[idx+1:])
(this.properties)[len(this.properties)-1] = &ActivityStreamsIconPropertyIterator{}
this.properties = (this.properties)[:len(this.properties)-1]
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsIconProperty) Serialize() (interface{}, error) {
s := make([]interface{}, 0, len(this.properties))
for _, iterator := range this.properties {
if b, err := iterator.serialize(); err != nil {
return s, err
} else {
s = append(s, b)
}
}
// Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example.
if len(s) == 1 {
return s[0], nil
}
return s, nil
}
// SetActivityStreamsImage sets a Image value to be at the specified index for the
// property "icon". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsIconProperty) SetActivityStreamsImage(idx int, v vocab.ActivityStreamsImage) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetActivityStreamsLink sets a Link value to be at the specified index for the
// property "icon". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsIconProperty) SetActivityStreamsLink(idx int, v vocab.ActivityStreamsLink) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetActivityStreamsMention sets a Mention value to be at the specified index for
// the property "icon". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsIconProperty) SetActivityStreamsMention(idx int, v vocab.ActivityStreamsMention) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsIconPropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetIRI sets an IRI value to be at the specified index for the property "icon".
// Panics if the index is out of bounds.
func (this *ActivityStreamsIconProperty) SetIRI(idx int, v *url.URL) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsIconPropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
}
// SetType sets an arbitrary type value to the specified index of the property
// "icon". Invalidates all iterators. Returns an error if the type is not a
// valid one to set for this property. Panics if the index is out of bounds.
func (this *ActivityStreamsIconProperty) SetType(idx int, t vocab.Type) error {
n := &ActivityStreamsIconPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
(this.properties)[idx] = n
return nil
}
// Swap swaps the location of values at two indices for the "icon" property.
func (this ActivityStreamsIconProperty) Swap(i, j int) {
this.properties[i], this.properties[j] = this.properties[j], this.properties[i]
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyimage contains the implementation for the image property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyimage

View File

@ -0,0 +1,30 @@
// Code generated by astool. DO NOT EDIT.
package propertyimage
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,824 @@
// Code generated by astool. DO NOT EDIT.
package propertyimage
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsImagePropertyIterator is an iterator for a property. It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsImagePropertyIterator struct {
activitystreamsImageMember vocab.ActivityStreamsImage
activitystreamsLinkMember vocab.ActivityStreamsLink
activitystreamsMentionMember vocab.ActivityStreamsMention
unknown interface{}
iri *url.URL
alias string
myIdx int
parent vocab.ActivityStreamsImageProperty
}
// NewActivityStreamsImagePropertyIterator creates a new ActivityStreamsImage
// property.
func NewActivityStreamsImagePropertyIterator() *ActivityStreamsImagePropertyIterator {
return &ActivityStreamsImagePropertyIterator{alias: ""}
}
// deserializeActivityStreamsImagePropertyIterator creates an iterator from an
// element that has been unmarshalled from a text or binary format.
func deserializeActivityStreamsImagePropertyIterator(i interface{}, aliasMap map[string]string) (*ActivityStreamsImagePropertyIterator, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsImagePropertyIterator{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeImageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsImagePropertyIterator{
activitystreamsImageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeLinkActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsImagePropertyIterator{
activitystreamsLinkMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsImagePropertyIterator{
activitystreamsMentionMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsImagePropertyIterator{
alias: alias,
unknown: i,
}
return this, nil
}
// GetActivityStreamsImage returns the value of this property. When
// IsActivityStreamsImage returns false, GetActivityStreamsImage will return
// an arbitrary value.
func (this ActivityStreamsImagePropertyIterator) GetActivityStreamsImage() vocab.ActivityStreamsImage {
return this.activitystreamsImageMember
}
// GetActivityStreamsLink returns the value of this property. When
// IsActivityStreamsLink returns false, GetActivityStreamsLink will return an
// arbitrary value.
func (this ActivityStreamsImagePropertyIterator) GetActivityStreamsLink() vocab.ActivityStreamsLink {
return this.activitystreamsLinkMember
}
// GetActivityStreamsMention returns the value of this property. When
// IsActivityStreamsMention returns false, GetActivityStreamsMention will
// return an arbitrary value.
func (this ActivityStreamsImagePropertyIterator) GetActivityStreamsMention() vocab.ActivityStreamsMention {
return this.activitystreamsMentionMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsImagePropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsImagePropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage()
}
if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink()
}
if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsImagePropertyIterator) HasAny() bool {
return this.IsActivityStreamsImage() ||
this.IsActivityStreamsLink() ||
this.IsActivityStreamsMention() ||
this.iri != nil
}
// IsActivityStreamsImage returns true if this property has a type of "Image".
// When true, use the GetActivityStreamsImage and SetActivityStreamsImage
// methods to access and set this property.
func (this ActivityStreamsImagePropertyIterator) IsActivityStreamsImage() bool {
return this.activitystreamsImageMember != nil
}
// IsActivityStreamsLink returns true if this property has a type of "Link". When
// true, use the GetActivityStreamsLink and SetActivityStreamsLink methods to
// access and set this property.
func (this ActivityStreamsImagePropertyIterator) IsActivityStreamsLink() bool {
return this.activitystreamsLinkMember != nil
}
// IsActivityStreamsMention returns true if this property has a type of "Mention".
// When true, use the GetActivityStreamsMention and SetActivityStreamsMention
// methods to access and set this property.
func (this ActivityStreamsImagePropertyIterator) IsActivityStreamsMention() bool {
return this.activitystreamsMentionMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsImagePropertyIterator) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsImagePropertyIterator) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsImage() {
child = this.GetActivityStreamsImage().JSONLDContext()
} else if this.IsActivityStreamsLink() {
child = this.GetActivityStreamsLink().JSONLDContext()
} else if this.IsActivityStreamsMention() {
child = this.GetActivityStreamsMention().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsImagePropertyIterator) KindIndex() int {
if this.IsActivityStreamsImage() {
return 0
}
if this.IsActivityStreamsLink() {
return 1
}
if this.IsActivityStreamsMention() {
return 2
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsImagePropertyIterator) LessThan(o vocab.ActivityStreamsImagePropertyIterator) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage().LessThan(o.GetActivityStreamsImage())
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink())
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "ActivityStreamsImage".
func (this ActivityStreamsImagePropertyIterator) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "ActivityStreamsImage"
} else {
return "ActivityStreamsImage"
}
}
// Next returns the next iterator, or nil if there is no next iterator.
func (this ActivityStreamsImagePropertyIterator) Next() vocab.ActivityStreamsImagePropertyIterator {
if this.myIdx+1 >= this.parent.Len() {
return nil
} else {
return this.parent.At(this.myIdx + 1)
}
}
// Prev returns the previous iterator, or nil if there is no previous iterator.
func (this ActivityStreamsImagePropertyIterator) Prev() vocab.ActivityStreamsImagePropertyIterator {
if this.myIdx-1 < 0 {
return nil
} else {
return this.parent.At(this.myIdx - 1)
}
}
// SetActivityStreamsImage sets the value of this property. Calling
// IsActivityStreamsImage afterwards returns true.
func (this *ActivityStreamsImagePropertyIterator) SetActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.clear()
this.activitystreamsImageMember = v
}
// SetActivityStreamsLink sets the value of this property. Calling
// IsActivityStreamsLink afterwards returns true.
func (this *ActivityStreamsImagePropertyIterator) SetActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.clear()
this.activitystreamsLinkMember = v
}
// SetActivityStreamsMention sets the value of this property. Calling
// IsActivityStreamsMention afterwards returns true.
func (this *ActivityStreamsImagePropertyIterator) SetActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.clear()
this.activitystreamsMentionMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsImagePropertyIterator) SetIRI(v *url.URL) {
this.clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsImagePropertyIterator) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsImage); ok {
this.SetActivityStreamsImage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsLink); ok {
this.SetActivityStreamsLink(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsMention); ok {
this.SetActivityStreamsMention(v)
return nil
}
return fmt.Errorf("illegal type to set on ActivityStreamsImage property: %T", t)
}
// clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsImagePropertyIterator) clear() {
this.activitystreamsImageMember = nil
this.activitystreamsLinkMember = nil
this.activitystreamsMentionMember = nil
this.unknown = nil
this.iri = nil
}
// serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsImagePropertyIterator) serialize() (interface{}, error) {
if this.IsActivityStreamsImage() {
return this.GetActivityStreamsImage().Serialize()
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().Serialize()
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// ActivityStreamsImageProperty is the non-functional property "image". It is
// permitted to have one or more values, and of different value types.
type ActivityStreamsImageProperty struct {
properties []*ActivityStreamsImagePropertyIterator
alias string
}
// DeserializeImageProperty creates a "image" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeImageProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsImageProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "image"
if len(alias) > 0 {
propName = fmt.Sprintf("%s:%s", alias, "image")
}
i, ok := m[propName]
if ok {
this := &ActivityStreamsImageProperty{
alias: alias,
properties: []*ActivityStreamsImagePropertyIterator{},
}
if list, ok := i.([]interface{}); ok {
for _, iterator := range list {
if p, err := deserializeActivityStreamsImagePropertyIterator(iterator, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
} else {
if p, err := deserializeActivityStreamsImagePropertyIterator(i, aliasMap); err != nil {
return this, err
} else if p != nil {
this.properties = append(this.properties, p)
}
}
// Set up the properties for iteration.
for idx, ele := range this.properties {
ele.parent = this
ele.myIdx = idx
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsImageProperty creates a new image property.
func NewActivityStreamsImageProperty() *ActivityStreamsImageProperty {
return &ActivityStreamsImageProperty{alias: ""}
}
// AppendActivityStreamsImage appends a Image value to the back of a list of the
// property "image". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsImageProperty) AppendActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.properties = append(this.properties, &ActivityStreamsImagePropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendActivityStreamsLink appends a Link value to the back of a list of the
// property "image". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsImageProperty) AppendActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.properties = append(this.properties, &ActivityStreamsImagePropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendActivityStreamsMention appends a Mention value to the back of a list of
// the property "image". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsImageProperty) AppendActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.properties = append(this.properties, &ActivityStreamsImagePropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: this.Len(),
parent: this,
})
}
// AppendIRI appends an IRI value to the back of a list of the property "image"
func (this *ActivityStreamsImageProperty) AppendIRI(v *url.URL) {
this.properties = append(this.properties, &ActivityStreamsImagePropertyIterator{
alias: this.alias,
iri: v,
myIdx: this.Len(),
parent: this,
})
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "image". Invalidates iterators that are traversing using Prev.
// Returns an error if the type is not a valid one to set for this property.
func (this *ActivityStreamsImageProperty) AppendType(t vocab.Type) error {
n := &ActivityStreamsImagePropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append(this.properties, n)
return nil
}
// At returns the property value for the specified index. Panics if the index is
// out of bounds.
func (this ActivityStreamsImageProperty) At(index int) vocab.ActivityStreamsImagePropertyIterator {
return this.properties[index]
}
// Begin returns the first iterator, or nil if empty. Can be used with the
// iterator's Next method and this property's End method to iterate from front
// to back through all values.
func (this ActivityStreamsImageProperty) Begin() vocab.ActivityStreamsImagePropertyIterator {
if this.Empty() {
return nil
} else {
return this.properties[0]
}
}
// Empty returns returns true if there are no elements.
func (this ActivityStreamsImageProperty) Empty() bool {
return this.Len() == 0
}
// End returns beyond-the-last iterator, which is nil. Can be used with the
// iterator's Next method and this property's Begin method to iterate from
// front to back through all values.
func (this ActivityStreamsImageProperty) End() vocab.ActivityStreamsImagePropertyIterator {
return nil
}
// InsertActivityStreamsImage inserts a Image value at the specified index for a
// property "image". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsImageProperty) InsertActivityStreamsImage(idx int, v vocab.ActivityStreamsImage) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertActivityStreamsLink inserts a Link value at the specified index for a
// property "image". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsImageProperty) InsertActivityStreamsLink(idx int, v vocab.ActivityStreamsLink) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertActivityStreamsMention inserts a Mention value at the specified index for
// a property "image". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsImageProperty) InsertActivityStreamsMention(idx int, v vocab.ActivityStreamsMention) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Insert inserts an IRI value at the specified index for a property "image".
// Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
func (this *ActivityStreamsImageProperty) InsertIRI(idx int, v *url.URL) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsImagePropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "image". Invalidates all iterators. Returns an error if the type
// is not a valid one to set for this property.
func (this *ActivityStreamsImageProperty) InsertType(idx int, t vocab.Type) error {
n := &ActivityStreamsImagePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = n
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
return nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsImageProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
for _, elem := range this.properties {
child := elem.JSONLDContext()
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API method specifically needed only for alternate implementations
// for go-fed. Applications should not use this method. Panics if the index is
// out of bounds.
func (this ActivityStreamsImageProperty) KindIndex(idx int) int {
return this.properties[idx].KindIndex()
}
// Len returns the number of values that exist for the "image" property.
func (this ActivityStreamsImageProperty) Len() (length int) {
return len(this.properties)
}
// Less computes whether another property is less than this one. Mixing types
// results in a consistent but arbitrary ordering
func (this ActivityStreamsImageProperty) Less(i, j int) bool {
idx1 := this.KindIndex(i)
idx2 := this.KindIndex(j)
if idx1 < idx2 {
return true
} else if idx1 == idx2 {
if idx1 == 0 {
lhs := this.properties[i].GetActivityStreamsImage()
rhs := this.properties[j].GetActivityStreamsImage()
return lhs.LessThan(rhs)
} else if idx1 == 1 {
lhs := this.properties[i].GetActivityStreamsLink()
rhs := this.properties[j].GetActivityStreamsLink()
return lhs.LessThan(rhs)
} else if idx1 == 2 {
lhs := this.properties[i].GetActivityStreamsMention()
rhs := this.properties[j].GetActivityStreamsMention()
return lhs.LessThan(rhs)
} else if idx1 == -2 {
lhs := this.properties[i].GetIRI()
rhs := this.properties[j].GetIRI()
return lhs.String() < rhs.String()
}
}
return false
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsImageProperty) LessThan(o vocab.ActivityStreamsImageProperty) bool {
l1 := this.Len()
l2 := o.Len()
l := l1
if l2 < l1 {
l = l2
}
for i := 0; i < l; i++ {
if this.properties[i].LessThan(o.At(i)) {
return true
} else if o.At(i).LessThan(this.properties[i]) {
return false
}
}
return l1 < l2
}
// Name returns the name of this property ("image") with any alias.
func (this ActivityStreamsImageProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "image"
} else {
return "image"
}
}
// PrependActivityStreamsImage prepends a Image value to the front of a list of
// the property "image". Invalidates all iterators.
func (this *ActivityStreamsImageProperty) PrependActivityStreamsImage(v vocab.ActivityStreamsImage) {
this.properties = append([]*ActivityStreamsImagePropertyIterator{{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependActivityStreamsLink prepends a Link value to the front of a list of the
// property "image". Invalidates all iterators.
func (this *ActivityStreamsImageProperty) PrependActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.properties = append([]*ActivityStreamsImagePropertyIterator{{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependActivityStreamsMention prepends a Mention value to the front of a list
// of the property "image". Invalidates all iterators.
func (this *ActivityStreamsImageProperty) PrependActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.properties = append([]*ActivityStreamsImagePropertyIterator{{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependIRI prepends an IRI value to the front of a list of the property "image".
func (this *ActivityStreamsImageProperty) PrependIRI(v *url.URL) {
this.properties = append([]*ActivityStreamsImagePropertyIterator{{
alias: this.alias,
iri: v,
myIdx: 0,
parent: this,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependType prepends an arbitrary type value to the front of a list of the
// property "image". Invalidates all iterators. Returns an error if the type
// is not a valid one to set for this property.
func (this *ActivityStreamsImageProperty) PrependType(t vocab.Type) error {
n := &ActivityStreamsImagePropertyIterator{
alias: this.alias,
myIdx: 0,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
this.properties = append([]*ActivityStreamsImagePropertyIterator{n}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
return nil
}
// Remove deletes an element at the specified index from a list of the property
// "image", regardless of its type. Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsImageProperty) Remove(idx int) {
(this.properties)[idx].parent = nil
copy((this.properties)[idx:], (this.properties)[idx+1:])
(this.properties)[len(this.properties)-1] = &ActivityStreamsImagePropertyIterator{}
this.properties = (this.properties)[:len(this.properties)-1]
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsImageProperty) Serialize() (interface{}, error) {
s := make([]interface{}, 0, len(this.properties))
for _, iterator := range this.properties {
if b, err := iterator.serialize(); err != nil {
return s, err
} else {
s = append(s, b)
}
}
// Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example.
if len(s) == 1 {
return s[0], nil
}
return s, nil
}
// SetActivityStreamsImage sets a Image value to be at the specified index for the
// property "image". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsImageProperty) SetActivityStreamsImage(idx int, v vocab.ActivityStreamsImage) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsImageMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetActivityStreamsLink sets a Link value to be at the specified index for the
// property "image". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsImageProperty) SetActivityStreamsLink(idx int, v vocab.ActivityStreamsLink) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsLinkMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetActivityStreamsMention sets a Mention value to be at the specified index for
// the property "image". Panics if the index is out of bounds. Invalidates all
// iterators.
func (this *ActivityStreamsImageProperty) SetActivityStreamsMention(idx int, v vocab.ActivityStreamsMention) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsImagePropertyIterator{
activitystreamsMentionMember: v,
alias: this.alias,
myIdx: idx,
parent: this,
}
}
// SetIRI sets an IRI value to be at the specified index for the property "image".
// Panics if the index is out of bounds.
func (this *ActivityStreamsImageProperty) SetIRI(idx int, v *url.URL) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsImagePropertyIterator{
alias: this.alias,
iri: v,
myIdx: idx,
parent: this,
}
}
// SetType sets an arbitrary type value to the specified index of the property
// "image". Invalidates all iterators. Returns an error if the type is not a
// valid one to set for this property. Panics if the index is out of bounds.
func (this *ActivityStreamsImageProperty) SetType(idx int, t vocab.Type) error {
n := &ActivityStreamsImagePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
}
if err := n.SetType(t); err != nil {
return err
}
(this.properties)[idx] = n
return nil
}
// Swap swaps the location of values at two indices for the "image" property.
func (this ActivityStreamsImageProperty) Swap(i, j int) {
this.properties[i], this.properties[j] = this.properties[j], this.properties[i]
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyinbox contains the implementation for the inbox property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyinbox

View File

@ -0,0 +1,27 @@
// Code generated by astool. DO NOT EDIT.
package propertyinbox
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,268 @@
// Code generated by astool. DO NOT EDIT.
package propertyinbox
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsInboxProperty is the functional property "inbox". It is
// permitted to be one of multiple value types. At most, one type of value can
// be present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsInboxProperty struct {
activitystreamsOrderedCollectionMember vocab.ActivityStreamsOrderedCollection
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeInboxProperty creates a "inbox" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeInboxProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsInboxProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "inbox"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "inbox")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsInboxProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeOrderedCollectionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsInboxProperty{
activitystreamsOrderedCollectionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsInboxProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsInboxProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsInboxProperty creates a new inbox property.
func NewActivityStreamsInboxProperty() *ActivityStreamsInboxProperty {
return &ActivityStreamsInboxProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsInboxProperty) Clear() {
this.activitystreamsOrderedCollectionMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsOrderedCollection returns the value of this property. When
// IsActivityStreamsOrderedCollection returns false,
// GetActivityStreamsOrderedCollection will return an arbitrary value.
func (this ActivityStreamsInboxProperty) GetActivityStreamsOrderedCollection() vocab.ActivityStreamsOrderedCollection {
return this.activitystreamsOrderedCollectionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsInboxProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsInboxProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsInboxProperty) GetType() vocab.Type {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsInboxProperty) HasAny() bool {
return this.IsActivityStreamsOrderedCollection() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsOrderedCollection returns true if this property has a type of
// "OrderedCollection". When true, use the GetActivityStreamsOrderedCollection
// and SetActivityStreamsOrderedCollection methods to access and set this
// property.
func (this ActivityStreamsInboxProperty) IsActivityStreamsOrderedCollection() bool {
return this.activitystreamsOrderedCollectionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsInboxProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsInboxProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsInboxProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsOrderedCollection() {
child = this.GetActivityStreamsOrderedCollection().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsInboxProperty) KindIndex() int {
if this.IsActivityStreamsOrderedCollection() {
return 0
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 1
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsInboxProperty) LessThan(o vocab.ActivityStreamsInboxProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().LessThan(o.GetActivityStreamsOrderedCollection())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "inbox".
func (this ActivityStreamsInboxProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "inbox"
} else {
return "inbox"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsInboxProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsOrderedCollection() {
return this.GetActivityStreamsOrderedCollection().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsOrderedCollection sets the value of this property. Calling
// IsActivityStreamsOrderedCollection afterwards returns true.
func (this *ActivityStreamsInboxProperty) SetActivityStreamsOrderedCollection(v vocab.ActivityStreamsOrderedCollection) {
this.Clear()
this.activitystreamsOrderedCollectionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsInboxProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsInboxProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsInboxProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsOrderedCollection); ok {
this.SetActivityStreamsOrderedCollection(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on inbox property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyinreplyto contains the implementation for the inReplyTo
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyinreplyto

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyinreplyto
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyinstrument contains the implementation for the instrument
// property. All applications are strongly encouraged to use the interface
// instead of this concrete definition. The interfaces allow applications to
// consume only the types and properties needed and be independent of the
// go-fed implementation if another alternative implementation is created.
// This package is code-generated and subject to the same license as the
// go-fed tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyinstrument

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyinstrument
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertyitems contains the implementation for the items property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertyitems

View File

@ -0,0 +1,265 @@
// Code generated by astool. DO NOT EDIT.
package propertyitems
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeAcceptActivityStreams returns the deserialization method for
// the "ActivityStreamsAccept" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAccept, error)
// DeserializeActivityActivityStreams returns the deserialization method
// for the "ActivityStreamsActivity" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsActivity, error)
// DeserializeAddActivityStreams returns the deserialization method for
// the "ActivityStreamsAdd" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeAddActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAdd, error)
// DeserializeAnnounceActivityStreams returns the deserialization method
// for the "ActivityStreamsAnnounce" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAnnounceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnnounce, error)
// DeserializeApplicationActivityStreams returns the deserialization
// method for the "ActivityStreamsApplication" non-functional property
// in the vocabulary "ActivityStreams"
DeserializeApplicationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsApplication, error)
// DeserializeArriveActivityStreams returns the deserialization method for
// the "ActivityStreamsArrive" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArriveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArrive, error)
// DeserializeArticleActivityStreams returns the deserialization method
// for the "ActivityStreamsArticle" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeArticleActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsArticle, error)
// DeserializeAudioActivityStreams returns the deserialization method for
// the "ActivityStreamsAudio" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeAudioActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudio, error)
// DeserializeBlockActivityStreams returns the deserialization method for
// the "ActivityStreamsBlock" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeBlockActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBlock, error)
// DeserializeBranchForgeFed returns the deserialization method for the
// "ForgeFedBranch" non-functional property in the vocabulary
// "ForgeFed"
DeserializeBranchForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedBranch, error)
// DeserializeCollectionActivityStreams returns the deserialization method
// for the "ActivityStreamsCollection" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollection, error)
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeCommitForgeFed returns the deserialization method for the
// "ForgeFedCommit" non-functional property in the vocabulary
// "ForgeFed"
DeserializeCommitForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedCommit, error)
// DeserializeCreateActivityStreams returns the deserialization method for
// the "ActivityStreamsCreate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeCreateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCreate, error)
// DeserializeDeleteActivityStreams returns the deserialization method for
// the "ActivityStreamsDelete" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDeleteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDelete, error)
// DeserializeDislikeActivityStreams returns the deserialization method
// for the "ActivityStreamsDislike" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDislikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDislike, error)
// DeserializeDocumentActivityStreams returns the deserialization method
// for the "ActivityStreamsDocument" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error)
// DeserializeEmojiToot returns the deserialization method for the
// "TootEmoji" non-functional property in the vocabulary "Toot"
DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error)
// DeserializeEventActivityStreams returns the deserialization method for
// the "ActivityStreamsEvent" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeEventActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEvent, error)
// DeserializeFlagActivityStreams returns the deserialization method for
// the "ActivityStreamsFlag" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeFlagActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFlag, error)
// DeserializeFollowActivityStreams returns the deserialization method for
// the "ActivityStreamsFollow" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeFollowActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsFollow, error)
// DeserializeGroupActivityStreams returns the deserialization method for
// the "ActivityStreamsGroup" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error)
// DeserializeIdentityProofToot returns the deserialization method for the
// "TootIdentityProof" non-functional property in the vocabulary "Toot"
DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error)
// DeserializeIgnoreActivityStreams returns the deserialization method for
// the "ActivityStreamsIgnore" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeIgnoreActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIgnore, error)
// DeserializeImageActivityStreams returns the deserialization method for
// the "ActivityStreamsImage" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeImageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImage, error)
// DeserializeIntransitiveActivityActivityStreams returns the
// deserialization method for the
// "ActivityStreamsIntransitiveActivity" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeIntransitiveActivityActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIntransitiveActivity, error)
// DeserializeInviteActivityStreams returns the deserialization method for
// the "ActivityStreamsInvite" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeInviteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInvite, error)
// DeserializeJoinActivityStreams returns the deserialization method for
// the "ActivityStreamsJoin" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeJoinActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsJoin, error)
// DeserializeLeaveActivityStreams returns the deserialization method for
// the "ActivityStreamsLeave" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeLeaveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLeave, error)
// DeserializeLikeActivityStreams returns the deserialization method for
// the "ActivityStreamsLike" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLikeActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLike, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeListenActivityStreams returns the deserialization method for
// the "ActivityStreamsListen" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeListenActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsListen, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeMoveActivityStreams returns the deserialization method for
// the "ActivityStreamsMove" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeMoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMove, error)
// DeserializeNoteActivityStreams returns the deserialization method for
// the "ActivityStreamsNote" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeNoteActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNote, error)
// DeserializeObjectActivityStreams returns the deserialization method for
// the "ActivityStreamsObject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeObjectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObject, error)
// DeserializeOfferActivityStreams returns the deserialization method for
// the "ActivityStreamsOffer" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeOfferActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOffer, error)
// DeserializeOrderedCollectionActivityStreams returns the deserialization
// method for the "ActivityStreamsOrderedCollection" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
// DeserializeOrganizationActivityStreams returns the deserialization
// method for the "ActivityStreamsOrganization" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeOrganizationActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrganization, error)
// DeserializePageActivityStreams returns the deserialization method for
// the "ActivityStreamsPage" non-functional property in the vocabulary
// "ActivityStreams"
DeserializePageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPage, error)
// DeserializePersonActivityStreams returns the deserialization method for
// the "ActivityStreamsPerson" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePersonActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPerson, error)
// DeserializePlaceActivityStreams returns the deserialization method for
// the "ActivityStreamsPlace" non-functional property in the
// vocabulary "ActivityStreams"
DeserializePlaceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPlace, error)
// DeserializeProfileActivityStreams returns the deserialization method
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)
// DeserializeQuestionActivityStreams returns the deserialization method
// for the "ActivityStreamsQuestion" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeQuestionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsQuestion, error)
// DeserializeReadActivityStreams returns the deserialization method for
// the "ActivityStreamsRead" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeReadActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRead, error)
// DeserializeRejectActivityStreams returns the deserialization method for
// the "ActivityStreamsReject" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsReject, error)
// DeserializeRelationshipActivityStreams returns the deserialization
// method for the "ActivityStreamsRelationship" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeRelationshipActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelationship, error)
// DeserializeRemoveActivityStreams returns the deserialization method for
// the "ActivityStreamsRemove" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeRemoveActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRemove, error)
// DeserializeRepositoryForgeFed returns the deserialization method for
// the "ForgeFedRepository" non-functional property in the vocabulary
// "ForgeFed"
DeserializeRepositoryForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedRepository, error)
// DeserializeServiceActivityStreams returns the deserialization method
// for the "ActivityStreamsService" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeServiceActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsService, error)
// DeserializeTentativeAcceptActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeAccept" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeAcceptActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeAccept, error)
// DeserializeTentativeRejectActivityStreams returns the deserialization
// method for the "ActivityStreamsTentativeReject" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeTentativeRejectActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTentativeReject, error)
// DeserializeTicketDependencyForgeFed returns the deserialization method
// for the "ForgeFedTicketDependency" non-functional property in the
// vocabulary "ForgeFed"
DeserializeTicketDependencyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketDependency, error)
// DeserializeTicketForgeFed returns the deserialization method for the
// "ForgeFedTicket" non-functional property in the vocabulary
// "ForgeFed"
DeserializeTicketForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicket, error)
// DeserializeTombstoneActivityStreams returns the deserialization method
// for the "ActivityStreamsTombstone" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTombstoneActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTombstone, error)
// DeserializeTravelActivityStreams returns the deserialization method for
// the "ActivityStreamsTravel" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeTravelActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTravel, error)
// DeserializeUndoActivityStreams returns the deserialization method for
// the "ActivityStreamsUndo" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeUndoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUndo, error)
// DeserializeUpdateActivityStreams returns the deserialization method for
// the "ActivityStreamsUpdate" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeUpdateActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdate, error)
// DeserializeVideoActivityStreams returns the deserialization method for
// the "ActivityStreamsVideo" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeVideoActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsVideo, error)
// DeserializeViewActivityStreams returns the deserialization method for
// the "ActivityStreamsView" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeViewActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsView, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertylast contains the implementation for the last property. All
// applications are strongly encouraged to use the interface instead of this
// concrete definition. The interfaces allow applications to consume only the
// types and properties needed and be independent of the go-fed implementation
// if another alternative implementation is created. This package is
// code-generated and subject to the same license as the go-fed tool used to
// generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertylast

View File

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package propertylast
import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
// DeserializeCollectionPageActivityStreams returns the deserialization
// method for the "ActivityStreamsCollectionPage" non-functional
// property in the vocabulary "ActivityStreams"
DeserializeCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCollectionPage, error)
// DeserializeLinkActivityStreams returns the deserialization method for
// the "ActivityStreamsLink" non-functional property in the vocabulary
// "ActivityStreams"
DeserializeLinkActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLink, error)
// DeserializeMentionActivityStreams returns the deserialization method
// for the "ActivityStreamsMention" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeMentionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMention, error)
// DeserializeOrderedCollectionPageActivityStreams returns the
// deserialization method for the
// "ActivityStreamsOrderedCollectionPage" non-functional property in
// the vocabulary "ActivityStreams"
DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error)
}
// SetManager sets the manager package-global variable. For internal use only, do
// not use as part of Application behavior. Must be called at golang init time.
func SetManager(m privateManager) {
mgr = m
}

View File

@ -0,0 +1,359 @@
// Code generated by astool. DO NOT EDIT.
package propertylast
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsLastProperty is the functional property "last". It is permitted
// to be one of multiple value types. At most, one type of value can be
// present, or none at all. Setting a value will clear the other types of
// values so that only one of the 'Is' methods will return true. It is
// possible to clear all values, so that this property is empty.
type ActivityStreamsLastProperty struct {
activitystreamsCollectionPageMember vocab.ActivityStreamsCollectionPage
activitystreamsLinkMember vocab.ActivityStreamsLink
activitystreamsMentionMember vocab.ActivityStreamsMention
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
unknown interface{}
iri *url.URL
alias string
}
// DeserializeLastProperty creates a "last" property from an interface
// representation that has been unmarshalled from a text or binary format.
func DeserializeLastProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsLastProperty, error) {
alias := ""
if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
alias = a
}
propName := "last"
if len(alias) > 0 {
// Use alias both to find the property, and set within the property.
propName = fmt.Sprintf("%s:%s", alias, "last")
}
i, ok := m[propName]
if ok {
if s, ok := i.(string); ok {
u, err := url.Parse(s)
// If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst
// Also, if no scheme exists, don't treat it as a URL -- net/url is greedy
if err == nil && len(u.Scheme) > 0 {
this := &ActivityStreamsLastProperty{
alias: alias,
iri: u,
}
return this, nil
}
}
if m, ok := i.(map[string]interface{}); ok {
if v, err := mgr.DeserializeCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsLastProperty{
activitystreamsCollectionPageMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeLinkActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsLastProperty{
activitystreamsLinkMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsLastProperty{
activitystreamsMentionMember: v,
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
this := &ActivityStreamsLastProperty{
activitystreamsOrderedCollectionPageMember: v,
alias: alias,
}
return this, nil
}
}
this := &ActivityStreamsLastProperty{
alias: alias,
unknown: i,
}
return this, nil
}
return nil, nil
}
// NewActivityStreamsLastProperty creates a new last property.
func NewActivityStreamsLastProperty() *ActivityStreamsLastProperty {
return &ActivityStreamsLastProperty{alias: ""}
}
// Clear ensures no value of this property is set. Calling HasAny or any of the
// 'Is' methods afterwards will return false.
func (this *ActivityStreamsLastProperty) Clear() {
this.activitystreamsCollectionPageMember = nil
this.activitystreamsLinkMember = nil
this.activitystreamsMentionMember = nil
this.activitystreamsOrderedCollectionPageMember = nil
this.unknown = nil
this.iri = nil
}
// GetActivityStreamsCollectionPage returns the value of this property. When
// IsActivityStreamsCollectionPage returns false,
// GetActivityStreamsCollectionPage will return an arbitrary value.
func (this ActivityStreamsLastProperty) GetActivityStreamsCollectionPage() vocab.ActivityStreamsCollectionPage {
return this.activitystreamsCollectionPageMember
}
// GetActivityStreamsLink returns the value of this property. When
// IsActivityStreamsLink returns false, GetActivityStreamsLink will return an
// arbitrary value.
func (this ActivityStreamsLastProperty) GetActivityStreamsLink() vocab.ActivityStreamsLink {
return this.activitystreamsLinkMember
}
// GetActivityStreamsMention returns the value of this property. When
// IsActivityStreamsMention returns false, GetActivityStreamsMention will
// return an arbitrary value.
func (this ActivityStreamsLastProperty) GetActivityStreamsMention() vocab.ActivityStreamsMention {
return this.activitystreamsMentionMember
}
// GetActivityStreamsOrderedCollectionPage returns the value of this property.
// When IsActivityStreamsOrderedCollectionPage returns false,
// GetActivityStreamsOrderedCollectionPage will return an arbitrary value.
func (this ActivityStreamsLastProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage {
return this.activitystreamsOrderedCollectionPageMember
}
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
// return an arbitrary value.
func (this ActivityStreamsLastProperty) GetIRI() *url.URL {
return this.iri
}
// GetType returns the value in this property as a Type. Returns nil if the value
// is not an ActivityStreams type, such as an IRI or another value.
func (this ActivityStreamsLastProperty) GetType() vocab.Type {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage()
}
if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink()
}
if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention()
}
if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage()
}
return nil
}
// HasAny returns true if any of the different values is set.
func (this ActivityStreamsLastProperty) HasAny() bool {
return this.IsActivityStreamsCollectionPage() ||
this.IsActivityStreamsLink() ||
this.IsActivityStreamsMention() ||
this.IsActivityStreamsOrderedCollectionPage() ||
this.iri != nil
}
// IsActivityStreamsCollectionPage returns true if this property has a type of
// "CollectionPage". When true, use the GetActivityStreamsCollectionPage and
// SetActivityStreamsCollectionPage methods to access and set this property.
func (this ActivityStreamsLastProperty) IsActivityStreamsCollectionPage() bool {
return this.activitystreamsCollectionPageMember != nil
}
// IsActivityStreamsLink returns true if this property has a type of "Link". When
// true, use the GetActivityStreamsLink and SetActivityStreamsLink methods to
// access and set this property.
func (this ActivityStreamsLastProperty) IsActivityStreamsLink() bool {
return this.activitystreamsLinkMember != nil
}
// IsActivityStreamsMention returns true if this property has a type of "Mention".
// When true, use the GetActivityStreamsMention and SetActivityStreamsMention
// methods to access and set this property.
func (this ActivityStreamsLastProperty) IsActivityStreamsMention() bool {
return this.activitystreamsMentionMember != nil
}
// IsActivityStreamsOrderedCollectionPage returns true if this property has a type
// of "OrderedCollectionPage". When true, use the
// GetActivityStreamsOrderedCollectionPage and
// SetActivityStreamsOrderedCollectionPage methods to access and set this
// property.
func (this ActivityStreamsLastProperty) IsActivityStreamsOrderedCollectionPage() bool {
return this.activitystreamsOrderedCollectionPageMember != nil
}
// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI
// to access and set this property
func (this ActivityStreamsLastProperty) IsIRI() bool {
return this.iri != nil
}
// JSONLDContext returns the JSONLD URIs required in the context string for this
// property and the specific values that are set. The value in the map is the
// alias used to import the property's value or values.
func (this ActivityStreamsLastProperty) JSONLDContext() map[string]string {
m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
var child map[string]string
if this.IsActivityStreamsCollectionPage() {
child = this.GetActivityStreamsCollectionPage().JSONLDContext()
} else if this.IsActivityStreamsLink() {
child = this.GetActivityStreamsLink().JSONLDContext()
} else if this.IsActivityStreamsMention() {
child = this.GetActivityStreamsMention().JSONLDContext()
} else if this.IsActivityStreamsOrderedCollectionPage() {
child = this.GetActivityStreamsOrderedCollectionPage().JSONLDContext()
}
/*
Since the literal maps in this function are determined at
code-generation time, this loop should not overwrite an existing key with a
new value.
*/
for k, v := range child {
m[k] = v
}
return m
}
// KindIndex computes an arbitrary value for indexing this kind of value. This is
// a leaky API detail only for folks looking to replace the go-fed
// implementation. Applications should not use this method.
func (this ActivityStreamsLastProperty) KindIndex() int {
if this.IsActivityStreamsCollectionPage() {
return 0
}
if this.IsActivityStreamsLink() {
return 1
}
if this.IsActivityStreamsMention() {
return 2
}
if this.IsActivityStreamsOrderedCollectionPage() {
return 3
}
if this.IsIRI() {
return -2
}
return -1
}
// LessThan compares two instances of this property with an arbitrary but stable
// comparison. Applications should not use this because it is only meant to
// help alternative implementations to go-fed to be able to normalize
// nonfunctional properties.
func (this ActivityStreamsLastProperty) LessThan(o vocab.ActivityStreamsLastProperty) bool {
idx1 := this.KindIndex()
idx2 := o.KindIndex()
if idx1 < idx2 {
return true
} else if idx1 > idx2 {
return false
} else if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().LessThan(o.GetActivityStreamsCollectionPage())
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink())
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention())
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage())
} else if this.IsIRI() {
return this.iri.String() < o.GetIRI().String()
}
return false
}
// Name returns the name of this property: "last".
func (this ActivityStreamsLastProperty) Name() string {
if len(this.alias) > 0 {
return this.alias + ":" + "last"
} else {
return "last"
}
}
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format. Applications should not need this
// function as most typical use cases serialize types instead of individual
// properties. It is exposed for alternatives to go-fed implementations to use.
func (this ActivityStreamsLastProperty) Serialize() (interface{}, error) {
if this.IsActivityStreamsCollectionPage() {
return this.GetActivityStreamsCollectionPage().Serialize()
} else if this.IsActivityStreamsLink() {
return this.GetActivityStreamsLink().Serialize()
} else if this.IsActivityStreamsMention() {
return this.GetActivityStreamsMention().Serialize()
} else if this.IsActivityStreamsOrderedCollectionPage() {
return this.GetActivityStreamsOrderedCollectionPage().Serialize()
} else if this.IsIRI() {
return this.iri.String(), nil
}
return this.unknown, nil
}
// SetActivityStreamsCollectionPage sets the value of this property. Calling
// IsActivityStreamsCollectionPage afterwards returns true.
func (this *ActivityStreamsLastProperty) SetActivityStreamsCollectionPage(v vocab.ActivityStreamsCollectionPage) {
this.Clear()
this.activitystreamsCollectionPageMember = v
}
// SetActivityStreamsLink sets the value of this property. Calling
// IsActivityStreamsLink afterwards returns true.
func (this *ActivityStreamsLastProperty) SetActivityStreamsLink(v vocab.ActivityStreamsLink) {
this.Clear()
this.activitystreamsLinkMember = v
}
// SetActivityStreamsMention sets the value of this property. Calling
// IsActivityStreamsMention afterwards returns true.
func (this *ActivityStreamsLastProperty) SetActivityStreamsMention(v vocab.ActivityStreamsMention) {
this.Clear()
this.activitystreamsMentionMember = v
}
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
func (this *ActivityStreamsLastProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
this.Clear()
this.activitystreamsOrderedCollectionPageMember = v
}
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
func (this *ActivityStreamsLastProperty) SetIRI(v *url.URL) {
this.Clear()
this.iri = v
}
// SetType attempts to set the property for the arbitrary type. Returns an error
// if it is not a valid type to set on this property.
func (this *ActivityStreamsLastProperty) SetType(t vocab.Type) error {
if v, ok := t.(vocab.ActivityStreamsCollectionPage); ok {
this.SetActivityStreamsCollectionPage(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsLink); ok {
this.SetActivityStreamsLink(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsMention); ok {
this.SetActivityStreamsMention(v)
return nil
}
if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok {
this.SetActivityStreamsOrderedCollectionPage(v)
return nil
}
return fmt.Errorf("illegal type to set on last property: %T", t)
}

View File

@ -0,0 +1,17 @@
// Code generated by astool. DO NOT EDIT.
// Package propertylatitude contains the implementation for the latitude property.
// All applications are strongly encouraged to use the interface instead of
// this concrete definition. The interfaces allow applications to consume only
// the types and properties needed and be independent of the go-fed
// implementation if another alternative implementation is created. This
// package is code-generated and subject to the same license as the go-fed
// tool used to generate it.
//
// This package is independent of other types' and properties' implementations
// by having a Manager injected into it to act as a factory for the concrete
// implementations. The implementations have been generated into their own
// separate subpackages for each vocabulary.
//
// Strongly consider using the interfaces instead of this package.
package propertylatitude

Some files were not shown because too many files have changed in this diff Show More