Regen code with dependency injected type property constructor.

This commit is contained in:
Cory Slep 2019-02-06 20:28:32 +01:00
parent a69135b238
commit 9fc75b87b8
109 changed files with 810 additions and 108 deletions

View File

@ -266,4 +266,58 @@ func init() {
typeupdate.SetManager(mgr)
typevideo.SetManager(mgr)
typeview.SetManager(mgr)
typeaccept.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeactivity.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeadd.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeannounce.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeapplication.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typearrive.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typearticle.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeaudio.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeblock.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typecollection.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typecollectionpage.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typecreate.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typedelete.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typedislike.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typedocument.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeevent.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeflag.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typefollow.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typegroup.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeignore.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeimage.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeintransitiveactivity.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeinvite.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typejoin.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeleave.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typelike.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typelink.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typelisten.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typemention.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typemove.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typenote.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeobject.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeoffer.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeorderedcollection.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeorderedcollectionpage.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeorganization.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typepage.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeperson.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeplace.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeprofile.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typequestion.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeread.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typereject.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typerelationship.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeremove.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeservice.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typetentativeaccept.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typetentativereject.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typetombstone.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typetravel.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeundo.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeupdate.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typevideo.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
typeview.SetTypePropertyConstructor(NewActivityStreamsTypeProperty)
}

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeaccept
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -435,7 +434,7 @@ func DeserializeAccept(m map[string]interface{}, aliasMap map[string]string) (*A
// NewAccept creates a new Accept type
func NewAccept() *Accept {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Accept")
return &Accept{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeactivity
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -415,7 +414,7 @@ func DeserializeActivity(m map[string]interface{}, aliasMap map[string]string) (
// NewActivity creates a new Activity type
func NewActivity() *Activity {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Activity")
return &Activity{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeadd
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -430,7 +429,7 @@ func DeserializeAdd(m map[string]interface{}, aliasMap map[string]string) (*Add,
// NewAdd creates a new Add type
func NewAdd() *Add {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Add")
return &Add{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeannounce
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -412,7 +411,7 @@ func DeserializeAnnounce(m map[string]interface{}, aliasMap map[string]string) (
// NewAnnounce creates a new Announce type
func NewAnnounce() *Announce {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Announce")
return &Announce{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeapplication
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -415,7 +414,7 @@ func DeserializeApplication(m map[string]interface{}, aliasMap map[string]string
// NewApplication creates a new Application type
func NewApplication() *Application {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Application")
return &Application{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -169,3 +171,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typearrive
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -404,7 +403,7 @@ func DeserializeArrive(m map[string]interface{}, aliasMap map[string]string) (*A
// NewArrive creates a new Arrive type
func NewArrive() *Arrive {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Arrive")
return &Arrive{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typearticle
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -361,7 +360,7 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (*
// NewArticle creates a new Article type
func NewArticle() *Article {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Article")
return &Article{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeaudio
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -363,7 +362,7 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Au
// NewAudio creates a new Audio type
func NewAudio() *Audio {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Audio")
return &Audio{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeblock
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -403,7 +402,7 @@ func DeserializeBlock(m map[string]interface{}, aliasMap map[string]string) (*Bl
// NewBlock creates a new Block type
func NewBlock() *Block {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Block")
return &Block{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typecollection
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -417,7 +416,7 @@ func DeserializeCollection(m map[string]interface{}, aliasMap map[string]string)
// NewCollection creates a new Collection type
func NewCollection() *Collection {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Collection")
return &Collection{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -185,3 +187,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typecollectionpage
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -442,7 +441,7 @@ func DeserializeCollectionPage(m map[string]interface{}, aliasMap map[string]str
// NewCollectionPage creates a new CollectionPage type
func NewCollectionPage() *CollectionPage {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("CollectionPage")
return &CollectionPage{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typecreate
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -407,7 +406,7 @@ func DeserializeCreate(m map[string]interface{}, aliasMap map[string]string) (*C
// NewCreate creates a new Create type
func NewCreate() *Create {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Create")
return &Create{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typedelete
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -408,7 +407,7 @@ func DeserializeDelete(m map[string]interface{}, aliasMap map[string]string) (*D
// NewDelete creates a new Delete type
func NewDelete() *Delete {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Delete")
return &Delete{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typedislike
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -400,7 +399,7 @@ func DislikeIsExtendedBy(other vocab.Type) bool {
// NewDislike creates a new Dislike type
func NewDislike() *Dislike {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Dislike")
return &Dislike{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typedocument
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -364,7 +363,7 @@ func DocumentIsExtendedBy(other vocab.Type) bool {
// NewDocument creates a new Document type
func NewDocument() *Document {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Document")
return &Document{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeevent
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -360,7 +359,7 @@ func EventIsExtendedBy(other vocab.Type) bool {
// NewEvent creates a new Event type
func NewEvent() *Event {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Event")
return &Event{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeflag
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -405,7 +404,7 @@ func FlagIsExtendedBy(other vocab.Type) bool {
// NewFlag creates a new Flag type
func NewFlag() *Flag {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Flag")
return &Flag{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typefollow
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -409,7 +408,7 @@ func FollowIsExtendedBy(other vocab.Type) bool {
// NewFollow creates a new Follow type
func NewFollow() *Follow {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Follow")
return &Follow{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typegroup
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -414,7 +413,7 @@ func GroupIsExtendedBy(other vocab.Type) bool {
// NewGroup creates a new Group type
func NewGroup() *Group {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Group")
return &Group{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeignore
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -409,7 +408,7 @@ func IgnoreIsExtendedBy(other vocab.Type) bool {
// NewIgnore creates a new Ignore type
func NewIgnore() *Ignore {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Ignore")
return &Ignore{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeimage
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -370,7 +369,7 @@ func ImageIsExtendedBy(other vocab.Type) bool {
// NewImage creates a new Image type
func NewImage() *Image {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Image")
return &Image{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeintransitiveactivity
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -414,7 +413,7 @@ func IntransitiveActivityIsExtendedBy(other vocab.Type) bool {
// NewIntransitiveActivity creates a new IntransitiveActivity type
func NewIntransitiveActivity() *IntransitiveActivity {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("IntransitiveActivity")
return &IntransitiveActivity{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeinvite
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -417,7 +416,7 @@ func InviteIsExtendedBy(other vocab.Type) bool {
// NewInvite creates a new Invite type
func NewInvite() *Invite {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Invite")
return &Invite{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typejoin
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -407,7 +406,7 @@ func JoinIsExtendedBy(other vocab.Type) bool {
// NewJoin creates a new Join type
func NewJoin() *Join {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Join")
return &Join{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeleave
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -421,7 +420,7 @@ func LeaveIsExtendedBy(other vocab.Type) bool {
// NewLeave creates a new Leave type
func NewLeave() *Leave {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Leave")
return &Leave{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typelike
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -404,7 +403,7 @@ func LikeIsExtendedBy(other vocab.Type) bool {
// NewLike creates a new Like type
func NewLike() *Like {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Like")
return &Like{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -69,3 +71,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typelink
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -199,7 +198,7 @@ func LinkIsExtendedBy(other vocab.Type) bool {
// NewLink creates a new Link type
func NewLink() *Link {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Link")
return &Link{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typelisten
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -403,7 +402,7 @@ func ListenIsExtendedBy(other vocab.Type) bool {
// NewListen creates a new Listen type
func NewListen() *Listen {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Listen")
return &Listen{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -69,3 +71,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typemention
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -192,7 +191,7 @@ func MentionIsExtendedBy(other vocab.Type) bool {
// NewMention creates a new Mention type
func NewMention() *Mention {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Mention")
return &Mention{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typemove
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -412,7 +411,7 @@ func MoveIsExtendedBy(other vocab.Type) bool {
// NewMove creates a new Move type
func NewMove() *Move {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Move")
return &Move{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typenote
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -330,7 +329,7 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Not
// NewNote creates a new Note type
func NewNote() *Note {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Note")
return &Note{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeobject
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -332,7 +331,7 @@ func DeserializeObject(m map[string]interface{}, aliasMap map[string]string) (*O
// NewObject creates a new Object type
func NewObject() *Object {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Object")
return &Object{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeoffer
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -381,7 +380,7 @@ func DeserializeOffer(m map[string]interface{}, aliasMap map[string]string) (*Of
// NewOffer creates a new Offer type
func NewOffer() *Offer {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Offer")
return &Offer{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeorderedcollection
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -380,7 +379,7 @@ func DeserializeOrderedCollection(m map[string]interface{}, aliasMap map[string]
// NewOrderedCollection creates a new OrderedCollection type
func NewOrderedCollection() *OrderedCollection {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("OrderedCollection")
return &OrderedCollection{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -189,3 +191,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeorderedcollectionpage
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -414,7 +413,7 @@ func DeserializeOrderedCollectionPage(m map[string]interface{}, aliasMap map[str
// NewOrderedCollectionPage creates a new OrderedCollectionPage type
func NewOrderedCollectionPage() *OrderedCollectionPage {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("OrderedCollectionPage")
return &OrderedCollectionPage{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeorganization
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -384,7 +383,7 @@ func DeserializeOrganization(m map[string]interface{}, aliasMap map[string]strin
// NewOrganization creates a new Organization type
func NewOrganization() *Organization {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Organization")
return &Organization{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -153,3 +155,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typepage
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -329,7 +328,7 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Pag
// NewPage creates a new Page type
func NewPage() *Page {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Page")
return &Page{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeperson
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -384,7 +383,7 @@ func DeserializePerson(m map[string]interface{}, aliasMap map[string]string) (*P
// NewPerson creates a new Person type
func NewPerson() *Person {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Person")
return &Person{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeplace
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -379,7 +378,7 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Pl
// NewPlace creates a new Place type
func NewPlace() *Place {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Place")
return &Place{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -157,3 +159,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeprofile
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -342,7 +341,7 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (*
// NewProfile creates a new Profile type
func NewProfile() *Profile {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Profile")
return &Profile{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typequestion
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -406,7 +405,7 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) (
// NewQuestion creates a new Question type
func NewQuestion() *Question {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Question")
return &Question{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeread
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -373,7 +372,7 @@ func DeserializeRead(m map[string]interface{}, aliasMap map[string]string) (*Rea
// NewRead creates a new Read type
func NewRead() *Read {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Read")
return &Read{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typereject
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -381,7 +380,7 @@ func DeserializeReject(m map[string]interface{}, aliasMap map[string]string) (*R
// NewReject creates a new Reject type
func NewReject() *Reject {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Reject")
return &Reject{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -161,3 +163,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typerelationship
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -355,7 +354,7 @@ func DeserializeRelationship(m map[string]interface{}, aliasMap map[string]strin
// NewRelationship creates a new Relationship type
func NewRelationship() *Relationship {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Relationship")
return &Relationship{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeremove
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -396,7 +395,7 @@ func DeserializeRemove(m map[string]interface{}, aliasMap map[string]string) (*R
// NewRemove creates a new Remove type
func NewRemove() *Remove {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Remove")
return &Remove{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -181,3 +183,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typeservice
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -384,7 +383,7 @@ func DeserializeService(m map[string]interface{}, aliasMap map[string]string) (*
// NewService creates a new Service type
func NewService() *Service {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Service")
return &Service{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typetentativeaccept
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -380,7 +379,7 @@ func DeserializeTentativeAccept(m map[string]interface{}, aliasMap map[string]st
// NewTentativeAccept creates a new TentativeAccept type
func NewTentativeAccept() *TentativeAccept {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("TentativeAccept")
return &TentativeAccept{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -173,3 +175,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typetentativereject
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -380,7 +379,7 @@ func DeserializeTentativeReject(m map[string]interface{}, aliasMap map[string]st
// NewTentativeReject creates a new TentativeReject type
func NewTentativeReject() *TentativeReject {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("TentativeReject")
return &TentativeReject{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -161,3 +163,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

View File

@ -2,7 +2,6 @@ package typetombstone
import (
"fmt"
propertytype "github.com/go-fed/activity/streams/impl/activitystreams/property_type"
vocab "github.com/go-fed/activity/streams/vocab"
"strings"
)
@ -363,7 +362,7 @@ func DeserializeTombstone(m map[string]interface{}, aliasMap map[string]string)
// NewTombstone creates a new Tombstone type
func NewTombstone() *Tombstone {
typeProp := propertytype.NewTypeProperty()
typeProp := typePropertyConstructor()
typeProp.AppendString("Tombstone")
return &Tombstone{
Type: typeProp,

View File

@ -4,6 +4,8 @@ import vocab "github.com/go-fed/activity/streams/vocab"
var mgr privateManager
var typePropertyConstructor func() vocab.TypePropertyInterface
// privateManager abstracts the code-generated manager that provides access to
// concrete implementations.
type privateManager interface {
@ -169,3 +171,14 @@ type jsonldContexter interface {
func SetManager(m privateManager) {
mgr = m
}
// SetTypePropertyConstructor sets the "type" property's constructor in the
// package-global variable. For internal use only, do not use as part of
// Application behavior. Must be called at golang init time. Permits
// ActivityStreams types to correctly set their "type" property at
// construction time, so users don't have to remember to do so each time. It
// is dependency injected so other go-fed compatible implementations could
// inject their own type.
func SetTypePropertyConstructor(f func() vocab.TypePropertyInterface) {
typePropertyConstructor = f
}

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