Current namespaces done
Namespaces Litepub, Misskey, Ostatus, Schema and W3Vcard are done Indicated in constants that SCHEMA_PROPERTYVALUE is an object type, not attribute name
This commit is contained in:
parent
b4c8c2caac
commit
8706a19357
6 changed files with 170 additions and 2 deletions
|
@ -85,8 +85,9 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
KEY_SCHEMA_VALUE = "http://schema.org#value" // The value for some field
|
KEY_SCHEMA_VALUE = "http://schema.org#value" // The value for some field
|
||||||
KEY_SCHEMA_PROPERTYVALUE = "http://schema.org#PropertyValue"
|
|
||||||
|
KEY_SCHEMA_PROPERTYVALUE = "http://schema.org#PropertyValue" // Object is of type property value
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
31
nsLitepub.go
31
nsLitepub.go
|
@ -1 +1,32 @@
|
||||||
package goap
|
package goap
|
||||||
|
|
||||||
|
type CapabilitiesData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Capabilities []map[string]any
|
||||||
|
}
|
||||||
|
|
||||||
|
func (capabilitiesdata *CapabilitiesData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return capabilitiesdata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (capabilitiesdata *CapabilitiesData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
capabilitiesdata.Next.MarshalToMap(),
|
||||||
|
KEY_LITEPUB_CAPABILITIES,
|
||||||
|
capabilitiesdata.Capabilities,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type OauthRegistrationEndpointData struct {
|
||||||
|
FullIdType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (oauthregistrationendpointdata *OauthRegistrationEndpointData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return oauthregistrationendpointdata.FullIdType.GetSelfOrBase()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (oauthregistrationendpointdata *OauthRegistrationEndpointData) MarshalToMap() map[string]any {
|
||||||
|
return oauthregistrationendpointdata.FullIdType.MarshalToMapWithName(
|
||||||
|
KEY_ACTIVITYSTREAMS_OAUTHAUTHORIZATION,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
51
nsMisskey.go
51
nsMisskey.go
|
@ -1 +1,52 @@
|
||||||
package goap
|
package goap
|
||||||
|
|
||||||
|
type MisskeySummaryData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Summary string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *MisskeySummaryData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return misskeysummarydata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *MisskeySummaryData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
misskeysummarydata.Next.MarshalToMap(),
|
||||||
|
KEY_MISSKEY_MKSUMMARY,
|
||||||
|
[]map[string]any{{KEY_VALUE: misskeysummarydata.Summary}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IsCatData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
IsCat bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iscatdata *IsCatData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return iscatdata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iscatdata *IsCatData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
iscatdata.Next.MarshalToMap(),
|
||||||
|
KEY_MISSKEY_ISCAT,
|
||||||
|
[]map[string]any{{KEY_VALUE: iscatdata.IsCat}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type SpeakAsCatData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
SpeaksAsCat bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iscatdata *SpeakAsCatData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return iscatdata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iscatdata *SpeakAsCatData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
iscatdata.Next.MarshalToMap(),
|
||||||
|
KEY_FIREFISH_SPEAKASCAT,
|
||||||
|
[]map[string]any{{KEY_VALUE: iscatdata.SpeaksAsCat}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
34
nsOstatus.go
34
nsOstatus.go
|
@ -1 +1,35 @@
|
||||||
package goap
|
package goap
|
||||||
|
|
||||||
|
type AtomUriData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Uri string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (atomurivalue *AtomUriData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return atomurivalue.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (atomurivalue *AtomUriData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
atomurivalue.Next.MarshalToMap(),
|
||||||
|
KEY_OSTATUS_ATOMURI,
|
||||||
|
[]map[string]any{{KEY_VALUE: atomurivalue.Uri}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConversationData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Uri string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (atomurivalue *ConversationData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return atomurivalue.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (atomurivalue *ConversationData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
atomurivalue.Next.MarshalToMap(),
|
||||||
|
KEY_OSTATUS_CONVERSATION,
|
||||||
|
[]map[string]any{{KEY_VALUE: atomurivalue.Uri}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
17
nsSchema.go
17
nsSchema.go
|
@ -1 +1,18 @@
|
||||||
package goap
|
package goap
|
||||||
|
|
||||||
|
type ValueData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Value ValueValue[string]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (namedata *ValueData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return namedata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (namedata *ValueData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
namedata.Next.MarshalToMap(),
|
||||||
|
KEY_SCHEMA_VALUE,
|
||||||
|
[]map[string]any{namedata.Value.Marshal()},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
34
nsW3Vcard.go
34
nsW3Vcard.go
|
@ -1 +1,35 @@
|
||||||
package goap
|
package goap
|
||||||
|
|
||||||
|
type AddressData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Address string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *AddressData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return misskeysummarydata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *AddressData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
misskeysummarydata.Next.MarshalToMap(),
|
||||||
|
KEY_W3_VCARD_ADRESS,
|
||||||
|
[]map[string]any{{KEY_VALUE: misskeysummarydata.Address}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type BirthdayData struct {
|
||||||
|
Next BaseApChain
|
||||||
|
Birthday string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *BirthdayData) GetSelfOrBase() (BaseApChain, bool) {
|
||||||
|
return misskeysummarydata.Next, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (misskeysummarydata *BirthdayData) MarshalToMap() map[string]any {
|
||||||
|
return appendWithKey(
|
||||||
|
misskeysummarydata.Next.MarshalToMap(),
|
||||||
|
KEY_W3_VCARD_BIRTHDAY,
|
||||||
|
[]map[string]any{{KEY_VALUE: misskeysummarydata.Birthday}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue