mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-23 03:22:55 -06:00
[chore] Move deps to code.superseriousbusiness.org (#4054)
This commit is contained in:
parent
8aba20fb72
commit
723c0af647
955 changed files with 1970 additions and 3639 deletions
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertyblurhash contains the implementation for the blurhash 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 propertyblurhash
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyblurhash
|
||||
|
||||
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
|
||||
}
|
||||
203
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go
generated
vendored
Normal file
203
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go
generated
vendored
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyblurhash
|
||||
|
||||
import (
|
||||
string1 "code.superseriousbusiness.org/activity/streams/values/string"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootBlurhashProperty is the functional property "blurhash". It is permitted to
|
||||
// be a single default-valued value type.
|
||||
type TootBlurhashProperty struct {
|
||||
xmlschemaStringMember string
|
||||
hasStringMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeBlurhashProperty creates a "blurhash" property from an interface
|
||||
// representation that has been unmarshalled from a text or binary format.
|
||||
func DeserializeBlurhashProperty(m map[string]interface{}, aliasMap map[string]string) (*TootBlurhashProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "blurhash"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "blurhash")
|
||||
}
|
||||
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 := &TootBlurhashProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := string1.DeserializeString(i); err == nil {
|
||||
this := &TootBlurhashProperty{
|
||||
alias: alias,
|
||||
hasStringMember: true,
|
||||
xmlschemaStringMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootBlurhashProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootBlurhashProperty creates a new blurhash property.
|
||||
func NewTootBlurhashProperty() *TootBlurhashProperty {
|
||||
return &TootBlurhashProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling IsXMLSchemaString
|
||||
// afterwards will return false.
|
||||
func (this *TootBlurhashProperty) Clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasStringMember = false
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaString returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootBlurhashProperty) Get() string {
|
||||
return this.xmlschemaStringMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootBlurhashProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootBlurhashProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaString() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootBlurhashProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaString returns true if this property is set and not an IRI.
|
||||
func (this TootBlurhashProperty) 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 TootBlurhashProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootBlurhashProperty) KindIndex() int {
|
||||
if this.IsXMLSchemaString() {
|
||||
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 TootBlurhashProperty) LessThan(o vocab.TootBlurhashProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Both are unknowns.
|
||||
return false
|
||||
} else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Values are always greater than unknown values.
|
||||
return false
|
||||
} else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() {
|
||||
// Unknowns are always less than known values.
|
||||
return true
|
||||
} else {
|
||||
// Actual comparison.
|
||||
return string1.LessString(this.Get(), o.Get())
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the name of this property: "blurhash".
|
||||
func (this TootBlurhashProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "blurhash"
|
||||
} else {
|
||||
return "blurhash"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootBlurhashProperty) Serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaString() {
|
||||
return string1.SerializeString(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaString afterwards will
|
||||
// return true.
|
||||
func (this *TootBlurhashProperty) Set(v string) {
|
||||
this.Clear()
|
||||
this.xmlschemaStringMember = v
|
||||
this.hasStringMember = true
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
|
||||
// true.
|
||||
func (this *TootBlurhashProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertydiscoverable contains the implementation for the discoverable
|
||||
// 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 propertydiscoverable
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertydiscoverable
|
||||
|
||||
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
|
||||
}
|
||||
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go
generated
vendored
Normal file
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go
generated
vendored
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertydiscoverable
|
||||
|
||||
import (
|
||||
boolean "code.superseriousbusiness.org/activity/streams/values/boolean"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootDiscoverableProperty is the functional property "discoverable". It is
|
||||
// permitted to be a single default-valued value type.
|
||||
type TootDiscoverableProperty struct {
|
||||
xmlschemaBooleanMember bool
|
||||
hasBooleanMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeDiscoverableProperty creates a "discoverable" property from an
|
||||
// interface representation that has been unmarshalled from a text or binary
|
||||
// format.
|
||||
func DeserializeDiscoverableProperty(m map[string]interface{}, aliasMap map[string]string) (*TootDiscoverableProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "discoverable"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "discoverable")
|
||||
}
|
||||
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 := &TootDiscoverableProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := boolean.DeserializeBoolean(i); err == nil {
|
||||
this := &TootDiscoverableProperty{
|
||||
alias: alias,
|
||||
hasBooleanMember: true,
|
||||
xmlschemaBooleanMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootDiscoverableProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootDiscoverableProperty creates a new discoverable property.
|
||||
func NewTootDiscoverableProperty() *TootDiscoverableProperty {
|
||||
return &TootDiscoverableProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling IsXMLSchemaBoolean
|
||||
// afterwards will return false.
|
||||
func (this *TootDiscoverableProperty) Clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasBooleanMember = false
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaBoolean returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootDiscoverableProperty) Get() bool {
|
||||
return this.xmlschemaBooleanMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootDiscoverableProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootDiscoverableProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaBoolean() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootDiscoverableProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaBoolean returns true if this property is set and not an IRI.
|
||||
func (this TootDiscoverableProperty) IsXMLSchemaBoolean() bool {
|
||||
return this.hasBooleanMember
|
||||
}
|
||||
|
||||
// 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 TootDiscoverableProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootDiscoverableProperty) KindIndex() int {
|
||||
if this.IsXMLSchemaBoolean() {
|
||||
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 TootDiscoverableProperty) LessThan(o vocab.TootDiscoverableProperty) 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.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() {
|
||||
// Both are unknowns.
|
||||
return false
|
||||
} else if this.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() {
|
||||
// Values are always greater than unknown values.
|
||||
return false
|
||||
} else if !this.IsXMLSchemaBoolean() && o.IsXMLSchemaBoolean() {
|
||||
// Unknowns are always less than known values.
|
||||
return true
|
||||
} else {
|
||||
// Actual comparison.
|
||||
return boolean.LessBoolean(this.Get(), o.Get())
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the name of this property: "discoverable".
|
||||
func (this TootDiscoverableProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "discoverable"
|
||||
} else {
|
||||
return "discoverable"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootDiscoverableProperty) Serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaBoolean() {
|
||||
return boolean.SerializeBoolean(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaBoolean afterwards will
|
||||
// return true.
|
||||
func (this *TootDiscoverableProperty) Set(v bool) {
|
||||
this.Clear()
|
||||
this.xmlschemaBooleanMember = v
|
||||
this.hasBooleanMember = true
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
|
||||
// true.
|
||||
func (this *TootDiscoverableProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertyfeatured contains the implementation for the featured 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 propertyfeatured
|
||||
27
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_pkg.go
generated
vendored
Normal file
27
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyfeatured
|
||||
|
||||
import vocab "code.superseriousbusiness.org/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
|
||||
}
|
||||
268
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_property_toot_featured.go
generated
vendored
Normal file
268
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_featured/gen_property_toot_featured.go
generated
vendored
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyfeatured
|
||||
|
||||
import (
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootFeaturedProperty is the functional property "featured". 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 TootFeaturedProperty struct {
|
||||
activitystreamsOrderedCollectionMember vocab.ActivityStreamsOrderedCollection
|
||||
activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeFeaturedProperty creates a "featured" property from an interface
|
||||
// representation that has been unmarshalled from a text or binary format.
|
||||
func DeserializeFeaturedProperty(m map[string]interface{}, aliasMap map[string]string) (*TootFeaturedProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "featured"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "featured")
|
||||
}
|
||||
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 := &TootFeaturedProperty{
|
||||
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 := &TootFeaturedProperty{
|
||||
activitystreamsOrderedCollectionMember: v,
|
||||
alias: alias,
|
||||
}
|
||||
return this, nil
|
||||
} else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil {
|
||||
this := &TootFeaturedProperty{
|
||||
activitystreamsOrderedCollectionPageMember: v,
|
||||
alias: alias,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
this := &TootFeaturedProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootFeaturedProperty creates a new featured property.
|
||||
func NewTootFeaturedProperty() *TootFeaturedProperty {
|
||||
return &TootFeaturedProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling HasAny or any of the
|
||||
// 'Is' methods afterwards will return false.
|
||||
func (this *TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) 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 TootFeaturedProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootFeaturedProperty) 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 TootFeaturedProperty) LessThan(o vocab.TootFeaturedProperty) 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: "featured".
|
||||
func (this TootFeaturedProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "featured"
|
||||
} else {
|
||||
return "featured"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootFeaturedProperty) 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 *TootFeaturedProperty) SetActivityStreamsOrderedCollection(v vocab.ActivityStreamsOrderedCollection) {
|
||||
this.Clear()
|
||||
this.activitystreamsOrderedCollectionMember = v
|
||||
}
|
||||
|
||||
// SetActivityStreamsOrderedCollectionPage sets the value of this property.
|
||||
// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true.
|
||||
func (this *TootFeaturedProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) {
|
||||
this.Clear()
|
||||
this.activitystreamsOrderedCollectionPageMember = v
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards returns true.
|
||||
func (this *TootFeaturedProperty) 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 *TootFeaturedProperty) 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 featured property: %T", t)
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertyfocalpoint contains the implementation for the focalPoint
|
||||
// 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 propertyfocalpoint
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyfocalpoint
|
||||
|
||||
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
|
||||
}
|
||||
531
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_property_toot_focalPoint.go
generated
vendored
Normal file
531
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_focalpoint/gen_property_toot_focalPoint.go
generated
vendored
Normal file
|
|
@ -0,0 +1,531 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyfocalpoint
|
||||
|
||||
import (
|
||||
float "code.superseriousbusiness.org/activity/streams/values/float"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootFocalPointPropertyIterator is an iterator for a property. It is permitted
|
||||
// to be a single default-valued value type.
|
||||
type TootFocalPointPropertyIterator struct {
|
||||
xmlschemaFloatMember float64
|
||||
hasFloatMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
myIdx int
|
||||
parent vocab.TootFocalPointProperty
|
||||
}
|
||||
|
||||
// NewTootFocalPointPropertyIterator creates a new TootFocalPoint property.
|
||||
func NewTootFocalPointPropertyIterator() *TootFocalPointPropertyIterator {
|
||||
return &TootFocalPointPropertyIterator{alias: ""}
|
||||
}
|
||||
|
||||
// deserializeTootFocalPointPropertyIterator creates an iterator from an element
|
||||
// that has been unmarshalled from a text or binary format.
|
||||
func deserializeTootFocalPointPropertyIterator(i interface{}, aliasMap map[string]string) (*TootFocalPointPropertyIterator, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; 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 := &TootFocalPointPropertyIterator{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := float.DeserializeFloat(i); err == nil {
|
||||
this := &TootFocalPointPropertyIterator{
|
||||
alias: alias,
|
||||
hasFloatMember: true,
|
||||
xmlschemaFloatMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootFocalPointPropertyIterator{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaFloat returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootFocalPointPropertyIterator) Get() float64 {
|
||||
return this.xmlschemaFloatMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootFocalPointPropertyIterator) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootFocalPointPropertyIterator) HasAny() bool {
|
||||
return this.IsXMLSchemaFloat() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootFocalPointPropertyIterator) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaFloat returns true if this property is set and not an IRI.
|
||||
func (this TootFocalPointPropertyIterator) 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 TootFocalPointPropertyIterator) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootFocalPointPropertyIterator) 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 TootFocalPointPropertyIterator) LessThan(o vocab.TootFocalPointPropertyIterator) 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: "TootFocalPoint".
|
||||
func (this TootFocalPointPropertyIterator) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "TootFocalPoint"
|
||||
} else {
|
||||
return "TootFocalPoint"
|
||||
}
|
||||
}
|
||||
|
||||
// Next returns the next iterator, or nil if there is no next iterator.
|
||||
func (this TootFocalPointPropertyIterator) Next() vocab.TootFocalPointPropertyIterator {
|
||||
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 TootFocalPointPropertyIterator) Prev() vocab.TootFocalPointPropertyIterator {
|
||||
if this.myIdx-1 < 0 {
|
||||
return nil
|
||||
} else {
|
||||
return this.parent.At(this.myIdx - 1)
|
||||
}
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaFloat afterwards will
|
||||
// return true.
|
||||
func (this *TootFocalPointPropertyIterator) 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 *TootFocalPointPropertyIterator) SetIRI(v *url.URL) {
|
||||
this.clear()
|
||||
this.iri = v
|
||||
}
|
||||
|
||||
// clear ensures no value of this property is set. Calling IsXMLSchemaFloat
|
||||
// afterwards will return false.
|
||||
func (this *TootFocalPointPropertyIterator) clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasFloatMember = false
|
||||
}
|
||||
|
||||
// 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 TootFocalPointPropertyIterator) serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaFloat() {
|
||||
return float.SerializeFloat(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// TootFocalPointProperty is the non-functional property "focalPoint". It is
|
||||
// permitted to have one or more values, and of different value types.
|
||||
type TootFocalPointProperty struct {
|
||||
properties []*TootFocalPointPropertyIterator
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeFocalPointProperty creates a "focalPoint" property from an interface
|
||||
// representation that has been unmarshalled from a text or binary format.
|
||||
func DeserializeFocalPointProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.TootFocalPointProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "focalPoint"
|
||||
if len(alias) > 0 {
|
||||
propName = fmt.Sprintf("%s:%s", alias, "focalPoint")
|
||||
}
|
||||
i, ok := m[propName]
|
||||
|
||||
if ok {
|
||||
this := &TootFocalPointProperty{
|
||||
alias: alias,
|
||||
properties: []*TootFocalPointPropertyIterator{},
|
||||
}
|
||||
if list, ok := i.([]interface{}); ok {
|
||||
for _, iterator := range list {
|
||||
if p, err := deserializeTootFocalPointPropertyIterator(iterator, aliasMap); err != nil {
|
||||
return this, err
|
||||
} else if p != nil {
|
||||
this.properties = append(this.properties, p)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if p, err := deserializeTootFocalPointPropertyIterator(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
|
||||
}
|
||||
|
||||
// NewTootFocalPointProperty creates a new focalPoint property.
|
||||
func NewTootFocalPointProperty() *TootFocalPointProperty {
|
||||
return &TootFocalPointProperty{alias: ""}
|
||||
}
|
||||
|
||||
// AppendIRI appends an IRI value to the back of a list of the property
|
||||
// "focalPoint"
|
||||
func (this *TootFocalPointProperty) AppendIRI(v *url.URL) {
|
||||
this.properties = append(this.properties, &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
iri: v,
|
||||
myIdx: this.Len(),
|
||||
parent: this,
|
||||
})
|
||||
}
|
||||
|
||||
// AppendXMLSchemaFloat appends a float value to the back of a list of the
|
||||
// property "focalPoint". Invalidates iterators that are traversing using Prev.
|
||||
func (this *TootFocalPointProperty) AppendXMLSchemaFloat(v float64) {
|
||||
this.properties = append(this.properties, &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
hasFloatMember: true,
|
||||
myIdx: this.Len(),
|
||||
parent: this,
|
||||
xmlschemaFloatMember: v,
|
||||
})
|
||||
}
|
||||
|
||||
// At returns the property value for the specified index. Panics if the index is
|
||||
// out of bounds.
|
||||
func (this TootFocalPointProperty) At(index int) vocab.TootFocalPointPropertyIterator {
|
||||
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 TootFocalPointProperty) Begin() vocab.TootFocalPointPropertyIterator {
|
||||
if this.Empty() {
|
||||
return nil
|
||||
} else {
|
||||
return this.properties[0]
|
||||
}
|
||||
}
|
||||
|
||||
// Empty returns returns true if there are no elements.
|
||||
func (this TootFocalPointProperty) 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 TootFocalPointProperty) End() vocab.TootFocalPointPropertyIterator {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Insert inserts an IRI value at the specified index for a property "focalPoint".
|
||||
// Existing elements at that index and higher are shifted back once.
|
||||
// Invalidates all iterators.
|
||||
func (this *TootFocalPointProperty) InsertIRI(idx int, v *url.URL) {
|
||||
this.properties = append(this.properties, nil)
|
||||
copy(this.properties[idx+1:], this.properties[idx:])
|
||||
this.properties[idx] = &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
iri: v,
|
||||
myIdx: idx,
|
||||
parent: this,
|
||||
}
|
||||
for i := idx; i < this.Len(); i++ {
|
||||
(this.properties)[i].myIdx = i
|
||||
}
|
||||
}
|
||||
|
||||
// InsertXMLSchemaFloat inserts a float value at the specified index for a
|
||||
// property "focalPoint". Existing elements at that index and higher are
|
||||
// shifted back once. Invalidates all iterators.
|
||||
func (this *TootFocalPointProperty) InsertXMLSchemaFloat(idx int, v float64) {
|
||||
this.properties = append(this.properties, nil)
|
||||
copy(this.properties[idx+1:], this.properties[idx:])
|
||||
this.properties[idx] = &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
hasFloatMember: true,
|
||||
myIdx: idx,
|
||||
parent: this,
|
||||
xmlschemaFloatMember: 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 TootFocalPointProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootFocalPointProperty) KindIndex(idx int) int {
|
||||
return this.properties[idx].KindIndex()
|
||||
}
|
||||
|
||||
// Len returns the number of values that exist for the "focalPoint" property.
|
||||
func (this TootFocalPointProperty) 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 TootFocalPointProperty) 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].Get()
|
||||
rhs := this.properties[j].Get()
|
||||
return float.LessFloat(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 TootFocalPointProperty) LessThan(o vocab.TootFocalPointProperty) 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 ("focalPoint") with any alias.
|
||||
func (this TootFocalPointProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "focalPoint"
|
||||
} else {
|
||||
return "focalPoint"
|
||||
}
|
||||
}
|
||||
|
||||
// PrependIRI prepends an IRI value to the front of a list of the property
|
||||
// "focalPoint".
|
||||
func (this *TootFocalPointProperty) PrependIRI(v *url.URL) {
|
||||
this.properties = append([]*TootFocalPointPropertyIterator{{
|
||||
alias: this.alias,
|
||||
iri: v,
|
||||
myIdx: 0,
|
||||
parent: this,
|
||||
}}, this.properties...)
|
||||
for i := 1; i < this.Len(); i++ {
|
||||
(this.properties)[i].myIdx = i
|
||||
}
|
||||
}
|
||||
|
||||
// PrependXMLSchemaFloat prepends a float value to the front of a list of the
|
||||
// property "focalPoint". Invalidates all iterators.
|
||||
func (this *TootFocalPointProperty) PrependXMLSchemaFloat(v float64) {
|
||||
this.properties = append([]*TootFocalPointPropertyIterator{{
|
||||
alias: this.alias,
|
||||
hasFloatMember: true,
|
||||
myIdx: 0,
|
||||
parent: this,
|
||||
xmlschemaFloatMember: 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
|
||||
// "focalPoint", regardless of its type. Panics if the index is out of bounds.
|
||||
// Invalidates all iterators.
|
||||
func (this *TootFocalPointProperty) Remove(idx int) {
|
||||
(this.properties)[idx].parent = nil
|
||||
copy((this.properties)[idx:], (this.properties)[idx+1:])
|
||||
(this.properties)[len(this.properties)-1] = &TootFocalPointPropertyIterator{}
|
||||
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 TootFocalPointProperty) 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
|
||||
}
|
||||
|
||||
// Set sets a float value to be at the specified index for the property
|
||||
// "focalPoint". Panics if the index is out of bounds. Invalidates all
|
||||
// iterators.
|
||||
func (this *TootFocalPointProperty) Set(idx int, v float64) {
|
||||
(this.properties)[idx].parent = nil
|
||||
(this.properties)[idx] = &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
hasFloatMember: true,
|
||||
myIdx: idx,
|
||||
parent: this,
|
||||
xmlschemaFloatMember: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetIRI sets an IRI value to be at the specified index for the property
|
||||
// "focalPoint". Panics if the index is out of bounds.
|
||||
func (this *TootFocalPointProperty) SetIRI(idx int, v *url.URL) {
|
||||
(this.properties)[idx].parent = nil
|
||||
(this.properties)[idx] = &TootFocalPointPropertyIterator{
|
||||
alias: this.alias,
|
||||
iri: v,
|
||||
myIdx: idx,
|
||||
parent: this,
|
||||
}
|
||||
}
|
||||
|
||||
// Swap swaps the location of values at two indices for the "focalPoint" property.
|
||||
func (this TootFocalPointProperty) Swap(i, j int) {
|
||||
this.properties[i], this.properties[j] = this.properties[j], this.properties[i]
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertyindexable contains the implementation for the indexable
|
||||
// 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 propertyindexable
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyindexable
|
||||
|
||||
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
|
||||
}
|
||||
203
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_property_toot_indexable.go
generated
vendored
Normal file
203
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_indexable/gen_property_toot_indexable.go
generated
vendored
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyindexable
|
||||
|
||||
import (
|
||||
boolean "code.superseriousbusiness.org/activity/streams/values/boolean"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootIndexableProperty is the functional property "indexable". It is permitted
|
||||
// to be a single default-valued value type.
|
||||
type TootIndexableProperty struct {
|
||||
xmlschemaBooleanMember bool
|
||||
hasBooleanMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeIndexableProperty creates a "indexable" property from an interface
|
||||
// representation that has been unmarshalled from a text or binary format.
|
||||
func DeserializeIndexableProperty(m map[string]interface{}, aliasMap map[string]string) (*TootIndexableProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "indexable"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "indexable")
|
||||
}
|
||||
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 := &TootIndexableProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := boolean.DeserializeBoolean(i); err == nil {
|
||||
this := &TootIndexableProperty{
|
||||
alias: alias,
|
||||
hasBooleanMember: true,
|
||||
xmlschemaBooleanMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootIndexableProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootIndexableProperty creates a new indexable property.
|
||||
func NewTootIndexableProperty() *TootIndexableProperty {
|
||||
return &TootIndexableProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling IsXMLSchemaBoolean
|
||||
// afterwards will return false.
|
||||
func (this *TootIndexableProperty) Clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasBooleanMember = false
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaBoolean returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootIndexableProperty) Get() bool {
|
||||
return this.xmlschemaBooleanMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootIndexableProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootIndexableProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaBoolean() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootIndexableProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaBoolean returns true if this property is set and not an IRI.
|
||||
func (this TootIndexableProperty) IsXMLSchemaBoolean() bool {
|
||||
return this.hasBooleanMember
|
||||
}
|
||||
|
||||
// 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 TootIndexableProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootIndexableProperty) KindIndex() int {
|
||||
if this.IsXMLSchemaBoolean() {
|
||||
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 TootIndexableProperty) LessThan(o vocab.TootIndexableProperty) 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.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() {
|
||||
// Both are unknowns.
|
||||
return false
|
||||
} else if this.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() {
|
||||
// Values are always greater than unknown values.
|
||||
return false
|
||||
} else if !this.IsXMLSchemaBoolean() && o.IsXMLSchemaBoolean() {
|
||||
// Unknowns are always less than known values.
|
||||
return true
|
||||
} else {
|
||||
// Actual comparison.
|
||||
return boolean.LessBoolean(this.Get(), o.Get())
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the name of this property: "indexable".
|
||||
func (this TootIndexableProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "indexable"
|
||||
} else {
|
||||
return "indexable"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootIndexableProperty) Serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaBoolean() {
|
||||
return boolean.SerializeBoolean(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaBoolean afterwards will
|
||||
// return true.
|
||||
func (this *TootIndexableProperty) Set(v bool) {
|
||||
this.Clear()
|
||||
this.xmlschemaBooleanMember = v
|
||||
this.hasBooleanMember = true
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
|
||||
// true.
|
||||
func (this *TootIndexableProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertysignaturealgorithm contains the implementation for the
|
||||
// signatureAlgorithm 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 propertysignaturealgorithm
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertysignaturealgorithm
|
||||
|
||||
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
|
||||
}
|
||||
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go
generated
vendored
Normal file
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go
generated
vendored
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertysignaturealgorithm
|
||||
|
||||
import (
|
||||
string1 "code.superseriousbusiness.org/activity/streams/values/string"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootSignatureAlgorithmProperty is the functional property "signatureAlgorithm".
|
||||
// It is permitted to be a single default-valued value type.
|
||||
type TootSignatureAlgorithmProperty struct {
|
||||
xmlschemaStringMember string
|
||||
hasStringMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeSignatureAlgorithmProperty creates a "signatureAlgorithm" property
|
||||
// from an interface representation that has been unmarshalled from a text or
|
||||
// binary format.
|
||||
func DeserializeSignatureAlgorithmProperty(m map[string]interface{}, aliasMap map[string]string) (*TootSignatureAlgorithmProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "signatureAlgorithm"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "signatureAlgorithm")
|
||||
}
|
||||
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 := &TootSignatureAlgorithmProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := string1.DeserializeString(i); err == nil {
|
||||
this := &TootSignatureAlgorithmProperty{
|
||||
alias: alias,
|
||||
hasStringMember: true,
|
||||
xmlschemaStringMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootSignatureAlgorithmProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootSignatureAlgorithmProperty creates a new signatureAlgorithm property.
|
||||
func NewTootSignatureAlgorithmProperty() *TootSignatureAlgorithmProperty {
|
||||
return &TootSignatureAlgorithmProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling IsXMLSchemaString
|
||||
// afterwards will return false.
|
||||
func (this *TootSignatureAlgorithmProperty) Clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasStringMember = false
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaString returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootSignatureAlgorithmProperty) Get() string {
|
||||
return this.xmlschemaStringMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootSignatureAlgorithmProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootSignatureAlgorithmProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaString() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootSignatureAlgorithmProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaString returns true if this property is set and not an IRI.
|
||||
func (this TootSignatureAlgorithmProperty) 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 TootSignatureAlgorithmProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootSignatureAlgorithmProperty) KindIndex() int {
|
||||
if this.IsXMLSchemaString() {
|
||||
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 TootSignatureAlgorithmProperty) LessThan(o vocab.TootSignatureAlgorithmProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Both are unknowns.
|
||||
return false
|
||||
} else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Values are always greater than unknown values.
|
||||
return false
|
||||
} else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() {
|
||||
// Unknowns are always less than known values.
|
||||
return true
|
||||
} else {
|
||||
// Actual comparison.
|
||||
return string1.LessString(this.Get(), o.Get())
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the name of this property: "signatureAlgorithm".
|
||||
func (this TootSignatureAlgorithmProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "signatureAlgorithm"
|
||||
} else {
|
||||
return "signatureAlgorithm"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootSignatureAlgorithmProperty) Serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaString() {
|
||||
return string1.SerializeString(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaString afterwards will
|
||||
// return true.
|
||||
func (this *TootSignatureAlgorithmProperty) Set(v string) {
|
||||
this.Clear()
|
||||
this.xmlschemaStringMember = v
|
||||
this.hasStringMember = true
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
|
||||
// true.
|
||||
func (this *TootSignatureAlgorithmProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertysignaturevalue contains the implementation for the
|
||||
// signatureValue 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 propertysignaturevalue
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertysignaturevalue
|
||||
|
||||
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
|
||||
}
|
||||
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go
generated
vendored
Normal file
204
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go
generated
vendored
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertysignaturevalue
|
||||
|
||||
import (
|
||||
string1 "code.superseriousbusiness.org/activity/streams/values/string"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootSignatureValueProperty is the functional property "signatureValue". It is
|
||||
// permitted to be a single default-valued value type.
|
||||
type TootSignatureValueProperty struct {
|
||||
xmlschemaStringMember string
|
||||
hasStringMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeSignatureValueProperty creates a "signatureValue" property from an
|
||||
// interface representation that has been unmarshalled from a text or binary
|
||||
// format.
|
||||
func DeserializeSignatureValueProperty(m map[string]interface{}, aliasMap map[string]string) (*TootSignatureValueProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "signatureValue"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "signatureValue")
|
||||
}
|
||||
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 := &TootSignatureValueProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := string1.DeserializeString(i); err == nil {
|
||||
this := &TootSignatureValueProperty{
|
||||
alias: alias,
|
||||
hasStringMember: true,
|
||||
xmlschemaStringMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootSignatureValueProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootSignatureValueProperty creates a new signatureValue property.
|
||||
func NewTootSignatureValueProperty() *TootSignatureValueProperty {
|
||||
return &TootSignatureValueProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling IsXMLSchemaString
|
||||
// afterwards will return false.
|
||||
func (this *TootSignatureValueProperty) Clear() {
|
||||
this.unknown = nil
|
||||
this.iri = nil
|
||||
this.hasStringMember = false
|
||||
}
|
||||
|
||||
// Get returns the value of this property. When IsXMLSchemaString returns false,
|
||||
// Get will return any arbitrary value.
|
||||
func (this TootSignatureValueProperty) Get() string {
|
||||
return this.xmlschemaStringMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootSignatureValueProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootSignatureValueProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaString() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootSignatureValueProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaString returns true if this property is set and not an IRI.
|
||||
func (this TootSignatureValueProperty) 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 TootSignatureValueProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootSignatureValueProperty) KindIndex() int {
|
||||
if this.IsXMLSchemaString() {
|
||||
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 TootSignatureValueProperty) LessThan(o vocab.TootSignatureValueProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Both are unknowns.
|
||||
return false
|
||||
} else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() {
|
||||
// Values are always greater than unknown values.
|
||||
return false
|
||||
} else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() {
|
||||
// Unknowns are always less than known values.
|
||||
return true
|
||||
} else {
|
||||
// Actual comparison.
|
||||
return string1.LessString(this.Get(), o.Get())
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the name of this property: "signatureValue".
|
||||
func (this TootSignatureValueProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "signatureValue"
|
||||
} else {
|
||||
return "signatureValue"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootSignatureValueProperty) Serialize() (interface{}, error) {
|
||||
if this.IsXMLSchemaString() {
|
||||
return string1.SerializeString(this.Get())
|
||||
} else if this.IsIRI() {
|
||||
return this.iri.String(), nil
|
||||
}
|
||||
return this.unknown, nil
|
||||
}
|
||||
|
||||
// Set sets the value of this property. Calling IsXMLSchemaString afterwards will
|
||||
// return true.
|
||||
func (this *TootSignatureValueProperty) Set(v string) {
|
||||
this.Clear()
|
||||
this.xmlschemaStringMember = v
|
||||
this.hasStringMember = true
|
||||
}
|
||||
|
||||
// SetIRI sets the value of this property. Calling IsIRI afterwards will return
|
||||
// true.
|
||||
func (this *TootSignatureValueProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package propertyvoterscount contains the implementation for the votersCount
|
||||
// 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 propertyvoterscount
|
||||
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_pkg.go
generated
vendored
Normal file
15
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyvoterscount
|
||||
|
||||
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
|
||||
}
|
||||
205
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go
generated
vendored
Normal file
205
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go
generated
vendored
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package propertyvoterscount
|
||||
|
||||
import (
|
||||
nonnegativeinteger "code.superseriousbusiness.org/activity/streams/values/nonNegativeInteger"
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// TootVotersCountProperty is the functional property "votersCount". It is
|
||||
// permitted to be a single default-valued value type.
|
||||
type TootVotersCountProperty struct {
|
||||
xmlschemaNonNegativeIntegerMember int
|
||||
hasNonNegativeIntegerMember bool
|
||||
unknown interface{}
|
||||
iri *url.URL
|
||||
alias string
|
||||
}
|
||||
|
||||
// DeserializeVotersCountProperty creates a "votersCount" property from an
|
||||
// interface representation that has been unmarshalled from a text or binary
|
||||
// format.
|
||||
func DeserializeVotersCountProperty(m map[string]interface{}, aliasMap map[string]string) (*TootVotersCountProperty, error) {
|
||||
alias := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
}
|
||||
propName := "votersCount"
|
||||
if len(alias) > 0 {
|
||||
// Use alias both to find the property, and set within the property.
|
||||
propName = fmt.Sprintf("%s:%s", alias, "votersCount")
|
||||
}
|
||||
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 := &TootVotersCountProperty{
|
||||
alias: alias,
|
||||
iri: u,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
}
|
||||
if v, err := nonnegativeinteger.DeserializeNonNegativeInteger(i); err == nil {
|
||||
this := &TootVotersCountProperty{
|
||||
alias: alias,
|
||||
hasNonNegativeIntegerMember: true,
|
||||
xmlschemaNonNegativeIntegerMember: v,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
this := &TootVotersCountProperty{
|
||||
alias: alias,
|
||||
unknown: i,
|
||||
}
|
||||
return this, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NewTootVotersCountProperty creates a new votersCount property.
|
||||
func NewTootVotersCountProperty() *TootVotersCountProperty {
|
||||
return &TootVotersCountProperty{alias: ""}
|
||||
}
|
||||
|
||||
// Clear ensures no value of this property is set. Calling
|
||||
// IsXMLSchemaNonNegativeInteger afterwards will return false.
|
||||
func (this *TootVotersCountProperty) 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 TootVotersCountProperty) Get() int {
|
||||
return this.xmlschemaNonNegativeIntegerMember
|
||||
}
|
||||
|
||||
// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will
|
||||
// return any arbitrary value.
|
||||
func (this TootVotersCountProperty) GetIRI() *url.URL {
|
||||
return this.iri
|
||||
}
|
||||
|
||||
// HasAny returns true if the value or IRI is set.
|
||||
func (this TootVotersCountProperty) HasAny() bool {
|
||||
return this.IsXMLSchemaNonNegativeInteger() || this.iri != nil
|
||||
}
|
||||
|
||||
// IsIRI returns true if this property is an IRI.
|
||||
func (this TootVotersCountProperty) IsIRI() bool {
|
||||
return this.iri != nil
|
||||
}
|
||||
|
||||
// IsXMLSchemaNonNegativeInteger returns true if this property is set and not an
|
||||
// IRI.
|
||||
func (this TootVotersCountProperty) 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 TootVotersCountProperty) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": 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 TootVotersCountProperty) 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 TootVotersCountProperty) LessThan(o vocab.TootVotersCountProperty) 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: "votersCount".
|
||||
func (this TootVotersCountProperty) Name() string {
|
||||
if len(this.alias) > 0 {
|
||||
return this.alias + ":" + "votersCount"
|
||||
} else {
|
||||
return "votersCount"
|
||||
}
|
||||
}
|
||||
|
||||
// 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 TootVotersCountProperty) 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 *TootVotersCountProperty) 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 *TootVotersCountProperty) SetIRI(v *url.URL) {
|
||||
this.Clear()
|
||||
this.iri = v
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package typeemoji contains the implementation for the Emoji type. 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 typeemoji
|
||||
179
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_pkg.go
generated
vendored
Normal file
179
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package typeemoji
|
||||
|
||||
import vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
|
||||
var mgr privateManager
|
||||
|
||||
var typePropertyConstructor func() vocab.JSONLDTypeProperty
|
||||
|
||||
// privateManager abstracts the code-generated manager that provides access to
|
||||
// concrete implementations.
|
||||
type privateManager interface {
|
||||
// DeserializeAltitudePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsAltitudeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error)
|
||||
// DeserializeAttachmentPropertyActivityStreams returns the
|
||||
// deserialization method for the "ActivityStreamsAttachmentProperty"
|
||||
// non-functional property in the vocabulary "ActivityStreams"
|
||||
DeserializeAttachmentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttachmentProperty, error)
|
||||
// DeserializeAttributedToPropertyActivityStreams returns the
|
||||
// deserialization method for the
|
||||
// "ActivityStreamsAttributedToProperty" non-functional property in
|
||||
// the vocabulary "ActivityStreams"
|
||||
DeserializeAttributedToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttributedToProperty, error)
|
||||
// DeserializeAudiencePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsAudienceProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeAudiencePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudienceProperty, error)
|
||||
// DeserializeBccPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsBccProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error)
|
||||
// DeserializeBtoPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsBtoProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeBtoPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBtoProperty, error)
|
||||
// DeserializeCcPropertyActivityStreams returns the deserialization method
|
||||
// for the "ActivityStreamsCcProperty" non-functional property in the
|
||||
// vocabulary "ActivityStreams"
|
||||
DeserializeCcPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCcProperty, error)
|
||||
// DeserializeContentPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsContentProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeContentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContentProperty, error)
|
||||
// DeserializeContextPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsContextProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error)
|
||||
// DeserializeDurationPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsDurationProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeDurationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDurationProperty, error)
|
||||
// DeserializeEndTimePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsEndTimeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error)
|
||||
// DeserializeGeneratorPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsGeneratorProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeGeneratorPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGeneratorProperty, error)
|
||||
// DeserializeIconPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsIconProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeIconPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIconProperty, error)
|
||||
// DeserializeIdPropertyJSONLD returns the deserialization method for the
|
||||
// "JSONLDIdProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error)
|
||||
// DeserializeImagePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsImageProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeImagePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImageProperty, error)
|
||||
// DeserializeInReplyToPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsInReplyToProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error)
|
||||
// DeserializeLikesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsLikesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeLikesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLikesProperty, error)
|
||||
// DeserializeLocationPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsLocationProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeLocationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLocationProperty, error)
|
||||
// DeserializeMediaTypePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsMediaTypeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeMediaTypePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMediaTypeProperty, error)
|
||||
// DeserializeNamePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsNameProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeNamePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNameProperty, error)
|
||||
// DeserializeObjectPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsObjectProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeObjectPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObjectProperty, error)
|
||||
// DeserializePreviewPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsPreviewProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializePreviewPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPreviewProperty, error)
|
||||
// DeserializePublishedPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsPublishedProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializePublishedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPublishedProperty, error)
|
||||
// DeserializeRepliesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsRepliesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeRepliesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRepliesProperty, error)
|
||||
// DeserializeSensitivePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSensitiveProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSensitivePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSensitiveProperty, error)
|
||||
// DeserializeSharesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSharesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSharesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSharesProperty, error)
|
||||
// DeserializeSourcePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSourceProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSourcePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSourceProperty, error)
|
||||
// DeserializeStartTimePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsStartTimeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeStartTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsStartTimeProperty, error)
|
||||
// DeserializeSummaryPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSummaryProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSummaryPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSummaryProperty, error)
|
||||
// DeserializeTagPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsTagProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, error)
|
||||
// DeserializeToPropertyActivityStreams returns the deserialization method
|
||||
// for the "ActivityStreamsToProperty" non-functional property in the
|
||||
// vocabulary "ActivityStreams"
|
||||
DeserializeToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsToProperty, error)
|
||||
// DeserializeTypePropertyJSONLD returns the deserialization method for
|
||||
// the "JSONLDTypeProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeTypePropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDTypeProperty, error)
|
||||
// DeserializeUpdatedPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsUpdatedProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeUpdatedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdatedProperty, error)
|
||||
// DeserializeUrlPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsUrlProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeUrlPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUrlProperty, error)
|
||||
}
|
||||
|
||||
// jsonldContexter is a private interface to determine the JSON-LD contexts and
|
||||
// aliases needed for functional and non-functional properties. It is a helper
|
||||
// interface for this implementation.
|
||||
type jsonldContexter interface {
|
||||
// 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.
|
||||
JSONLDContext() map[string]string
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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.JSONLDTypeProperty) {
|
||||
typePropertyConstructor = f
|
||||
}
|
||||
1655
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go
generated
vendored
Normal file
1655
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package typehashtag contains the implementation for the Hashtag type. 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 typehashtag
|
||||
91
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_pkg.go
generated
vendored
Normal file
91
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package typehashtag
|
||||
|
||||
import vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
|
||||
var mgr privateManager
|
||||
|
||||
var typePropertyConstructor func() vocab.JSONLDTypeProperty
|
||||
|
||||
// privateManager abstracts the code-generated manager that provides access to
|
||||
// concrete implementations.
|
||||
type privateManager interface {
|
||||
// DeserializeAttributedToPropertyActivityStreams returns the
|
||||
// deserialization method for the
|
||||
// "ActivityStreamsAttributedToProperty" non-functional property in
|
||||
// the vocabulary "ActivityStreams"
|
||||
DeserializeAttributedToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttributedToProperty, error)
|
||||
// DeserializeHeightPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsHeightProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeHeightPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHeightProperty, error)
|
||||
// DeserializeHrefPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsHrefProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeHrefPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHrefProperty, error)
|
||||
// DeserializeHreflangPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsHreflangProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeHreflangPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHreflangProperty, error)
|
||||
// DeserializeIdPropertyJSONLD returns the deserialization method for the
|
||||
// "JSONLDIdProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error)
|
||||
// DeserializeMediaTypePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsMediaTypeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeMediaTypePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMediaTypeProperty, error)
|
||||
// DeserializeNamePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsNameProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeNamePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNameProperty, error)
|
||||
// DeserializePreviewPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsPreviewProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializePreviewPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPreviewProperty, error)
|
||||
// DeserializeRelPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsRelProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeRelPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelProperty, error)
|
||||
// DeserializeSummaryPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSummaryProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSummaryPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSummaryProperty, error)
|
||||
// DeserializeTypePropertyJSONLD returns the deserialization method for
|
||||
// the "JSONLDTypeProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeTypePropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDTypeProperty, error)
|
||||
// DeserializeWidthPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsWidthProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeWidthPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsWidthProperty, error)
|
||||
}
|
||||
|
||||
// jsonldContexter is a private interface to determine the JSON-LD contexts and
|
||||
// aliases needed for functional and non-functional properties. It is a helper
|
||||
// interface for this implementation.
|
||||
type jsonldContexter interface {
|
||||
// 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.
|
||||
JSONLDContext() map[string]string
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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.JSONLDTypeProperty) {
|
||||
typePropertyConstructor = f
|
||||
}
|
||||
726
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_type_toot_hashtag.go
generated
vendored
Normal file
726
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_hashtag/gen_type_toot_hashtag.go
generated
vendored
Normal file
|
|
@ -0,0 +1,726 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package typehashtag
|
||||
|
||||
import (
|
||||
vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// {
|
||||
// "content": "example",
|
||||
// "id": "https://example.com/@alice/hello-world",
|
||||
// "tag": [
|
||||
// {
|
||||
// "href": "https://example.com/hashtag/example",
|
||||
// "name": "#example",
|
||||
// "type": "Hashtag"
|
||||
// }
|
||||
// ],
|
||||
// "type": "Note"
|
||||
// }
|
||||
type TootHashtag struct {
|
||||
ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty
|
||||
ActivityStreamsHeight vocab.ActivityStreamsHeightProperty
|
||||
ActivityStreamsHref vocab.ActivityStreamsHrefProperty
|
||||
ActivityStreamsHreflang vocab.ActivityStreamsHreflangProperty
|
||||
JSONLDId vocab.JSONLDIdProperty
|
||||
ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty
|
||||
ActivityStreamsName vocab.ActivityStreamsNameProperty
|
||||
ActivityStreamsPreview vocab.ActivityStreamsPreviewProperty
|
||||
ActivityStreamsRel vocab.ActivityStreamsRelProperty
|
||||
ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty
|
||||
JSONLDType vocab.JSONLDTypeProperty
|
||||
ActivityStreamsWidth vocab.ActivityStreamsWidthProperty
|
||||
alias string
|
||||
unknown map[string]interface{}
|
||||
}
|
||||
|
||||
// DeserializeHashtag creates a Hashtag from a map representation that has been
|
||||
// unmarshalled from a text or binary format.
|
||||
func DeserializeHashtag(m map[string]interface{}, aliasMap map[string]string) (*TootHashtag, error) {
|
||||
alias := ""
|
||||
aliasPrefix := ""
|
||||
if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok {
|
||||
alias = a
|
||||
aliasPrefix = a + ":"
|
||||
}
|
||||
this := &TootHashtag{
|
||||
alias: alias,
|
||||
unknown: make(map[string]interface{}),
|
||||
}
|
||||
if typeValue, ok := m["type"]; !ok {
|
||||
return nil, fmt.Errorf("no \"type\" property in map")
|
||||
} else if typeString, ok := typeValue.(string); ok {
|
||||
typeName := strings.TrimPrefix(typeString, aliasPrefix)
|
||||
if typeName != "Hashtag" {
|
||||
return nil, fmt.Errorf("\"type\" property is not of %q type: %s", "Hashtag", typeName)
|
||||
}
|
||||
// Fall through, success in finding a proper Type
|
||||
} else if arrType, ok := typeValue.([]interface{}); ok {
|
||||
found := false
|
||||
for _, elemVal := range arrType {
|
||||
if typeString, ok := elemVal.(string); ok && strings.TrimPrefix(typeString, aliasPrefix) == "Hashtag" {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
return nil, fmt.Errorf("could not find a \"type\" property of value %q", "Hashtag")
|
||||
}
|
||||
// Fall through, success in finding a proper Type
|
||||
} else {
|
||||
return nil, fmt.Errorf("\"type\" property is unrecognized type: %T", typeValue)
|
||||
}
|
||||
// Begin: Known property deserialization
|
||||
if p, err := mgr.DeserializeAttributedToPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsAttributedTo = p
|
||||
}
|
||||
if p, err := mgr.DeserializeHeightPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsHeight = p
|
||||
}
|
||||
if p, err := mgr.DeserializeHrefPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsHref = p
|
||||
}
|
||||
if p, err := mgr.DeserializeHreflangPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsHreflang = p
|
||||
}
|
||||
if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.JSONLDId = p
|
||||
}
|
||||
if p, err := mgr.DeserializeMediaTypePropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsMediaType = p
|
||||
}
|
||||
if p, err := mgr.DeserializeNamePropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsName = p
|
||||
}
|
||||
if p, err := mgr.DeserializePreviewPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsPreview = p
|
||||
}
|
||||
if p, err := mgr.DeserializeRelPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsRel = p
|
||||
}
|
||||
if p, err := mgr.DeserializeSummaryPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsSummary = p
|
||||
}
|
||||
if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.JSONLDType = p
|
||||
}
|
||||
if p, err := mgr.DeserializeWidthPropertyActivityStreams()(m, aliasMap); err != nil {
|
||||
return nil, err
|
||||
} else if p != nil {
|
||||
this.ActivityStreamsWidth = p
|
||||
}
|
||||
// End: Known property deserialization
|
||||
|
||||
// Begin: Unknown deserialization
|
||||
for k, v := range m {
|
||||
// Begin: Code that ensures a property name is unknown
|
||||
if k == "attributedTo" {
|
||||
continue
|
||||
} else if k == "height" {
|
||||
continue
|
||||
} else if k == "href" {
|
||||
continue
|
||||
} else if k == "hreflang" {
|
||||
continue
|
||||
} else if k == "id" {
|
||||
continue
|
||||
} else if k == "mediaType" {
|
||||
continue
|
||||
} else if k == "name" {
|
||||
continue
|
||||
} else if k == "nameMap" {
|
||||
continue
|
||||
} else if k == "preview" {
|
||||
continue
|
||||
} else if k == "rel" {
|
||||
continue
|
||||
} else if k == "summary" {
|
||||
continue
|
||||
} else if k == "summaryMap" {
|
||||
continue
|
||||
} else if k == "type" {
|
||||
continue
|
||||
} else if k == "width" {
|
||||
continue
|
||||
} // End: Code that ensures a property name is unknown
|
||||
|
||||
this.unknown[k] = v
|
||||
}
|
||||
// End: Unknown deserialization
|
||||
|
||||
return this, nil
|
||||
}
|
||||
|
||||
// HashtagIsDisjointWith returns true if the other provided type is disjoint with
|
||||
// the Hashtag type.
|
||||
func HashtagIsDisjointWith(other vocab.Type) bool {
|
||||
disjointWith := []string{"Accept", "Activity", "Add", "Album", "Announce", "AnnounceApproval", "AnnounceAuthorization", "AnnounceRequest", "Application", "Arrive", "Article", "Artist", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Emoji", "Event", "Flag", "Follow", "Group", "IdentityProof", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Library", "Like", "LikeApproval", "LikeAuthorization", "LikeRequest", "Listen", "Move", "Note", "Object", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "PropertyValue", "Question", "Read", "Reject", "Relationship", "Remove", "ReplyApproval", "ReplyAuthorization", "ReplyRequest", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Track", "Travel", "Undo", "Update", "Video", "View"}
|
||||
for _, disjoint := range disjointWith {
|
||||
if disjoint == other.GetTypeName() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// HashtagIsExtendedBy returns true if the other provided type extends from the
|
||||
// Hashtag type. Note that it returns false if the types are the same; see the
|
||||
// "IsOrExtendsHashtag" variant instead.
|
||||
func HashtagIsExtendedBy(other vocab.Type) bool {
|
||||
// Shortcut implementation: is not extended by anything.
|
||||
return false
|
||||
}
|
||||
|
||||
// IsOrExtendsHashtag returns true if the other provided type is the Hashtag type
|
||||
// or extends from the Hashtag type.
|
||||
func IsOrExtendsHashtag(other vocab.Type) bool {
|
||||
if other.GetTypeName() == "Hashtag" {
|
||||
return true
|
||||
}
|
||||
return HashtagIsExtendedBy(other)
|
||||
}
|
||||
|
||||
// NewTootHashtag creates a new Hashtag type
|
||||
func NewTootHashtag() *TootHashtag {
|
||||
typeProp := typePropertyConstructor()
|
||||
typeProp.AppendXMLSchemaString("Hashtag")
|
||||
return &TootHashtag{
|
||||
JSONLDType: typeProp,
|
||||
alias: "",
|
||||
unknown: make(map[string]interface{}),
|
||||
}
|
||||
}
|
||||
|
||||
// TootHashtagExtends returns true if the Hashtag type extends from the other type.
|
||||
func TootHashtagExtends(other vocab.Type) bool {
|
||||
extensions := []string{"Link"}
|
||||
for _, ext := range extensions {
|
||||
if ext == other.GetTypeName() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetActivityStreamsAttributedTo returns the "attributedTo" property if it
|
||||
// exists, and nil otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty {
|
||||
return this.ActivityStreamsAttributedTo
|
||||
}
|
||||
|
||||
// GetActivityStreamsHeight returns the "height" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsHeight() vocab.ActivityStreamsHeightProperty {
|
||||
return this.ActivityStreamsHeight
|
||||
}
|
||||
|
||||
// GetActivityStreamsHref returns the "href" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsHref() vocab.ActivityStreamsHrefProperty {
|
||||
return this.ActivityStreamsHref
|
||||
}
|
||||
|
||||
// GetActivityStreamsHreflang returns the "hreflang" property if it exists, and
|
||||
// nil otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsHreflang() vocab.ActivityStreamsHreflangProperty {
|
||||
return this.ActivityStreamsHreflang
|
||||
}
|
||||
|
||||
// GetActivityStreamsMediaType returns the "mediaType" property if it exists, and
|
||||
// nil otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty {
|
||||
return this.ActivityStreamsMediaType
|
||||
}
|
||||
|
||||
// GetActivityStreamsName returns the "name" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsName() vocab.ActivityStreamsNameProperty {
|
||||
return this.ActivityStreamsName
|
||||
}
|
||||
|
||||
// GetActivityStreamsPreview returns the "preview" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsPreview() vocab.ActivityStreamsPreviewProperty {
|
||||
return this.ActivityStreamsPreview
|
||||
}
|
||||
|
||||
// GetActivityStreamsRel returns the "rel" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsRel() vocab.ActivityStreamsRelProperty {
|
||||
return this.ActivityStreamsRel
|
||||
}
|
||||
|
||||
// GetActivityStreamsSummary returns the "summary" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty {
|
||||
return this.ActivityStreamsSummary
|
||||
}
|
||||
|
||||
// GetActivityStreamsWidth returns the "width" property if it exists, and nil
|
||||
// otherwise.
|
||||
func (this TootHashtag) GetActivityStreamsWidth() vocab.ActivityStreamsWidthProperty {
|
||||
return this.ActivityStreamsWidth
|
||||
}
|
||||
|
||||
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
|
||||
func (this TootHashtag) GetJSONLDId() vocab.JSONLDIdProperty {
|
||||
return this.JSONLDId
|
||||
}
|
||||
|
||||
// GetJSONLDType returns the "type" property if it exists, and nil otherwise.
|
||||
func (this TootHashtag) GetJSONLDType() vocab.JSONLDTypeProperty {
|
||||
return this.JSONLDType
|
||||
}
|
||||
|
||||
// GetTypeName returns the name of this type.
|
||||
func (this TootHashtag) GetTypeName() string {
|
||||
return "Hashtag"
|
||||
}
|
||||
|
||||
// GetUnknownProperties returns the unknown properties for the Hashtag type. Note
|
||||
// that this should not be used by app developers. It is only used to help
|
||||
// determine which implementation is LessThan the other. Developers who are
|
||||
// creating a different implementation of this type's interface can use this
|
||||
// method in their LessThan implementation, but routine ActivityPub
|
||||
// applications should not use this to bypass the code generation tool.
|
||||
func (this TootHashtag) GetUnknownProperties() map[string]interface{} {
|
||||
return this.unknown
|
||||
}
|
||||
|
||||
// IsExtending returns true if the Hashtag type extends from the other type.
|
||||
func (this TootHashtag) IsExtending(other vocab.Type) bool {
|
||||
return TootHashtagExtends(other)
|
||||
}
|
||||
|
||||
// JSONLDContext returns the JSONLD URIs required in the context string for this
|
||||
// type and the specific properties that are set. The value in the map is the
|
||||
// alias used to import the type and its properties.
|
||||
func (this TootHashtag) JSONLDContext() map[string]string {
|
||||
m := map[string]string{"http://joinmastodon.org/ns": this.alias}
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsHeight, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsHref, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsHreflang, m)
|
||||
m = this.helperJSONLDContext(this.JSONLDId, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsName, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsPreview, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsRel, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsSummary, m)
|
||||
m = this.helperJSONLDContext(this.JSONLDType, m)
|
||||
m = this.helperJSONLDContext(this.ActivityStreamsWidth, m)
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
// LessThan computes if this Hashtag is lesser, with an arbitrary but stable
|
||||
// determination.
|
||||
func (this TootHashtag) LessThan(o vocab.TootHashtag) bool {
|
||||
// Begin: Compare known properties
|
||||
// Compare property "attributedTo"
|
||||
if lhs, rhs := this.ActivityStreamsAttributedTo, o.GetActivityStreamsAttributedTo(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "height"
|
||||
if lhs, rhs := this.ActivityStreamsHeight, o.GetActivityStreamsHeight(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "href"
|
||||
if lhs, rhs := this.ActivityStreamsHref, o.GetActivityStreamsHref(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "hreflang"
|
||||
if lhs, rhs := this.ActivityStreamsHreflang, o.GetActivityStreamsHreflang(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "id"
|
||||
if lhs, rhs := this.JSONLDId, o.GetJSONLDId(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "mediaType"
|
||||
if lhs, rhs := this.ActivityStreamsMediaType, o.GetActivityStreamsMediaType(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "name"
|
||||
if lhs, rhs := this.ActivityStreamsName, o.GetActivityStreamsName(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "preview"
|
||||
if lhs, rhs := this.ActivityStreamsPreview, o.GetActivityStreamsPreview(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "rel"
|
||||
if lhs, rhs := this.ActivityStreamsRel, o.GetActivityStreamsRel(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "summary"
|
||||
if lhs, rhs := this.ActivityStreamsSummary, o.GetActivityStreamsSummary(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "type"
|
||||
if lhs, rhs := this.JSONLDType, o.GetJSONLDType(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// Compare property "width"
|
||||
if lhs, rhs := this.ActivityStreamsWidth, o.GetActivityStreamsWidth(); lhs != nil && rhs != nil {
|
||||
if lhs.LessThan(rhs) {
|
||||
return true
|
||||
} else if rhs.LessThan(lhs) {
|
||||
return false
|
||||
}
|
||||
} else if lhs == nil && rhs != nil {
|
||||
// Nil is less than anything else
|
||||
return true
|
||||
} else if rhs != nil && rhs == nil {
|
||||
// Anything else is greater than nil
|
||||
return false
|
||||
} // Else: Both are nil
|
||||
// End: Compare known properties
|
||||
|
||||
// Begin: Compare unknown properties (only by number of them)
|
||||
if len(this.unknown) < len(o.GetUnknownProperties()) {
|
||||
return true
|
||||
} else if len(o.GetUnknownProperties()) < len(this.unknown) {
|
||||
return false
|
||||
} // End: Compare unknown properties (only by number of them)
|
||||
|
||||
// All properties are the same.
|
||||
return false
|
||||
}
|
||||
|
||||
// Serialize converts this into an interface representation suitable for
|
||||
// marshalling into a text or binary format.
|
||||
func (this TootHashtag) Serialize() (map[string]interface{}, error) {
|
||||
m := make(map[string]interface{})
|
||||
typeName := "Hashtag"
|
||||
if len(this.alias) > 0 {
|
||||
typeName = this.alias + ":" + "Hashtag"
|
||||
}
|
||||
m["type"] = typeName
|
||||
// Begin: Serialize known properties
|
||||
// Maybe serialize property "attributedTo"
|
||||
if this.ActivityStreamsAttributedTo != nil {
|
||||
if i, err := this.ActivityStreamsAttributedTo.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsAttributedTo.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "height"
|
||||
if this.ActivityStreamsHeight != nil {
|
||||
if i, err := this.ActivityStreamsHeight.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsHeight.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "href"
|
||||
if this.ActivityStreamsHref != nil {
|
||||
if i, err := this.ActivityStreamsHref.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsHref.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "hreflang"
|
||||
if this.ActivityStreamsHreflang != nil {
|
||||
if i, err := this.ActivityStreamsHreflang.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsHreflang.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "id"
|
||||
if this.JSONLDId != nil {
|
||||
if i, err := this.JSONLDId.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.JSONLDId.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "mediaType"
|
||||
if this.ActivityStreamsMediaType != nil {
|
||||
if i, err := this.ActivityStreamsMediaType.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsMediaType.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "name"
|
||||
if this.ActivityStreamsName != nil {
|
||||
if i, err := this.ActivityStreamsName.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsName.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "preview"
|
||||
if this.ActivityStreamsPreview != nil {
|
||||
if i, err := this.ActivityStreamsPreview.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsPreview.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "rel"
|
||||
if this.ActivityStreamsRel != nil {
|
||||
if i, err := this.ActivityStreamsRel.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsRel.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "summary"
|
||||
if this.ActivityStreamsSummary != nil {
|
||||
if i, err := this.ActivityStreamsSummary.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsSummary.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "type"
|
||||
if this.JSONLDType != nil {
|
||||
if i, err := this.JSONLDType.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.JSONLDType.Name()] = i
|
||||
}
|
||||
}
|
||||
// Maybe serialize property "width"
|
||||
if this.ActivityStreamsWidth != nil {
|
||||
if i, err := this.ActivityStreamsWidth.Serialize(); err != nil {
|
||||
return nil, err
|
||||
} else if i != nil {
|
||||
m[this.ActivityStreamsWidth.Name()] = i
|
||||
}
|
||||
}
|
||||
// End: Serialize known properties
|
||||
|
||||
// Begin: Serialize unknown properties
|
||||
for k, v := range this.unknown {
|
||||
// To be safe, ensure we aren't overwriting a known property
|
||||
if _, has := m[k]; !has {
|
||||
m[k] = v
|
||||
}
|
||||
}
|
||||
// End: Serialize unknown properties
|
||||
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// SetActivityStreamsAttributedTo sets the "attributedTo" property.
|
||||
func (this *TootHashtag) SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty) {
|
||||
this.ActivityStreamsAttributedTo = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsHeight sets the "height" property.
|
||||
func (this *TootHashtag) SetActivityStreamsHeight(i vocab.ActivityStreamsHeightProperty) {
|
||||
this.ActivityStreamsHeight = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsHref sets the "href" property.
|
||||
func (this *TootHashtag) SetActivityStreamsHref(i vocab.ActivityStreamsHrefProperty) {
|
||||
this.ActivityStreamsHref = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsHreflang sets the "hreflang" property.
|
||||
func (this *TootHashtag) SetActivityStreamsHreflang(i vocab.ActivityStreamsHreflangProperty) {
|
||||
this.ActivityStreamsHreflang = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsMediaType sets the "mediaType" property.
|
||||
func (this *TootHashtag) SetActivityStreamsMediaType(i vocab.ActivityStreamsMediaTypeProperty) {
|
||||
this.ActivityStreamsMediaType = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsName sets the "name" property.
|
||||
func (this *TootHashtag) SetActivityStreamsName(i vocab.ActivityStreamsNameProperty) {
|
||||
this.ActivityStreamsName = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsPreview sets the "preview" property.
|
||||
func (this *TootHashtag) SetActivityStreamsPreview(i vocab.ActivityStreamsPreviewProperty) {
|
||||
this.ActivityStreamsPreview = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsRel sets the "rel" property.
|
||||
func (this *TootHashtag) SetActivityStreamsRel(i vocab.ActivityStreamsRelProperty) {
|
||||
this.ActivityStreamsRel = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsSummary sets the "summary" property.
|
||||
func (this *TootHashtag) SetActivityStreamsSummary(i vocab.ActivityStreamsSummaryProperty) {
|
||||
this.ActivityStreamsSummary = i
|
||||
}
|
||||
|
||||
// SetActivityStreamsWidth sets the "width" property.
|
||||
func (this *TootHashtag) SetActivityStreamsWidth(i vocab.ActivityStreamsWidthProperty) {
|
||||
this.ActivityStreamsWidth = i
|
||||
}
|
||||
|
||||
// SetJSONLDId sets the "id" property.
|
||||
func (this *TootHashtag) SetJSONLDId(i vocab.JSONLDIdProperty) {
|
||||
this.JSONLDId = i
|
||||
}
|
||||
|
||||
// SetJSONLDType sets the "type" property.
|
||||
func (this *TootHashtag) SetJSONLDType(i vocab.JSONLDTypeProperty) {
|
||||
this.JSONLDType = i
|
||||
}
|
||||
|
||||
// VocabularyURI returns the vocabulary's URI as a string.
|
||||
func (this TootHashtag) VocabularyURI() string {
|
||||
return "http://joinmastodon.org/ns"
|
||||
}
|
||||
|
||||
// helperJSONLDContext obtains the context uris and their aliases from a property,
|
||||
// if it is not nil.
|
||||
func (this TootHashtag) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string {
|
||||
if i == nil {
|
||||
return toMerge
|
||||
}
|
||||
for k, v := range i.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.
|
||||
*/
|
||||
toMerge[k] = v
|
||||
}
|
||||
return toMerge
|
||||
}
|
||||
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_doc.go
generated
vendored
Normal file
17
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
// Package typeidentityproof contains the implementation for the IdentityProof
|
||||
// type. 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 typeidentityproof
|
||||
187
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_pkg.go
generated
vendored
Normal file
187
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_pkg.go
generated
vendored
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
// Code generated by astool. DO NOT EDIT.
|
||||
|
||||
package typeidentityproof
|
||||
|
||||
import vocab "code.superseriousbusiness.org/activity/streams/vocab"
|
||||
|
||||
var mgr privateManager
|
||||
|
||||
var typePropertyConstructor func() vocab.JSONLDTypeProperty
|
||||
|
||||
// privateManager abstracts the code-generated manager that provides access to
|
||||
// concrete implementations.
|
||||
type privateManager interface {
|
||||
// DeserializeAltitudePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsAltitudeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error)
|
||||
// DeserializeAttachmentPropertyActivityStreams returns the
|
||||
// deserialization method for the "ActivityStreamsAttachmentProperty"
|
||||
// non-functional property in the vocabulary "ActivityStreams"
|
||||
DeserializeAttachmentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttachmentProperty, error)
|
||||
// DeserializeAttributedToPropertyActivityStreams returns the
|
||||
// deserialization method for the
|
||||
// "ActivityStreamsAttributedToProperty" non-functional property in
|
||||
// the vocabulary "ActivityStreams"
|
||||
DeserializeAttributedToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttributedToProperty, error)
|
||||
// DeserializeAudiencePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsAudienceProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeAudiencePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudienceProperty, error)
|
||||
// DeserializeBccPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsBccProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error)
|
||||
// DeserializeBtoPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsBtoProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeBtoPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBtoProperty, error)
|
||||
// DeserializeCcPropertyActivityStreams returns the deserialization method
|
||||
// for the "ActivityStreamsCcProperty" non-functional property in the
|
||||
// vocabulary "ActivityStreams"
|
||||
DeserializeCcPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCcProperty, error)
|
||||
// DeserializeContentPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsContentProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeContentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContentProperty, error)
|
||||
// DeserializeContextPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsContextProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error)
|
||||
// DeserializeDurationPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsDurationProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeDurationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDurationProperty, error)
|
||||
// DeserializeEndTimePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsEndTimeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error)
|
||||
// DeserializeGeneratorPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsGeneratorProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeGeneratorPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGeneratorProperty, error)
|
||||
// DeserializeIconPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsIconProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeIconPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIconProperty, error)
|
||||
// DeserializeIdPropertyJSONLD returns the deserialization method for the
|
||||
// "JSONLDIdProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error)
|
||||
// DeserializeImagePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsImageProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeImagePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImageProperty, error)
|
||||
// DeserializeInReplyToPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsInReplyToProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error)
|
||||
// DeserializeLikesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsLikesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeLikesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLikesProperty, error)
|
||||
// DeserializeLocationPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsLocationProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeLocationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLocationProperty, error)
|
||||
// DeserializeMediaTypePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsMediaTypeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeMediaTypePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMediaTypeProperty, error)
|
||||
// DeserializeNamePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsNameProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeNamePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNameProperty, error)
|
||||
// DeserializeObjectPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsObjectProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeObjectPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObjectProperty, error)
|
||||
// DeserializePreviewPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsPreviewProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializePreviewPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPreviewProperty, error)
|
||||
// DeserializePublishedPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsPublishedProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializePublishedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPublishedProperty, error)
|
||||
// DeserializeRepliesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsRepliesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeRepliesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRepliesProperty, error)
|
||||
// DeserializeSensitivePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSensitiveProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSensitivePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSensitiveProperty, error)
|
||||
// DeserializeSharesPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSharesProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSharesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSharesProperty, error)
|
||||
// DeserializeSignatureAlgorithmPropertyToot returns the deserialization
|
||||
// method for the "TootSignatureAlgorithmProperty" non-functional
|
||||
// property in the vocabulary "Toot"
|
||||
DeserializeSignatureAlgorithmPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureAlgorithmProperty, error)
|
||||
// DeserializeSignatureValuePropertyToot returns the deserialization
|
||||
// method for the "TootSignatureValueProperty" non-functional property
|
||||
// in the vocabulary "Toot"
|
||||
DeserializeSignatureValuePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureValueProperty, error)
|
||||
// DeserializeSourcePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSourceProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSourcePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSourceProperty, error)
|
||||
// DeserializeStartTimePropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsStartTimeProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeStartTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsStartTimeProperty, error)
|
||||
// DeserializeSummaryPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsSummaryProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeSummaryPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSummaryProperty, error)
|
||||
// DeserializeTagPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsTagProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, error)
|
||||
// DeserializeToPropertyActivityStreams returns the deserialization method
|
||||
// for the "ActivityStreamsToProperty" non-functional property in the
|
||||
// vocabulary "ActivityStreams"
|
||||
DeserializeToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsToProperty, error)
|
||||
// DeserializeTypePropertyJSONLD returns the deserialization method for
|
||||
// the "JSONLDTypeProperty" non-functional property in the vocabulary
|
||||
// "JSONLD"
|
||||
DeserializeTypePropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDTypeProperty, error)
|
||||
// DeserializeUpdatedPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsUpdatedProperty" non-functional
|
||||
// property in the vocabulary "ActivityStreams"
|
||||
DeserializeUpdatedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdatedProperty, error)
|
||||
// DeserializeUrlPropertyActivityStreams returns the deserialization
|
||||
// method for the "ActivityStreamsUrlProperty" non-functional property
|
||||
// in the vocabulary "ActivityStreams"
|
||||
DeserializeUrlPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUrlProperty, error)
|
||||
}
|
||||
|
||||
// jsonldContexter is a private interface to determine the JSON-LD contexts and
|
||||
// aliases needed for functional and non-functional properties. It is a helper
|
||||
// interface for this implementation.
|
||||
type jsonldContexter interface {
|
||||
// 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.
|
||||
JSONLDContext() map[string]string
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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.JSONLDTypeProperty) {
|
||||
typePropertyConstructor = f
|
||||
}
|
||||
1724
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go
generated
vendored
Normal file
1724
vendor/code.superseriousbusiness.org/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue