Add W3, Masto and W3 Security namespaces
All current keys in the constants for those namespaces (that are attributes) are now added Also remove useless import in the ActivityStreams namespace
This commit is contained in:
parent
64bb620425
commit
a11353cc38
4 changed files with 151 additions and 1 deletions
|
@ -3,7 +3,6 @@ package goap
|
|||
import (
|
||||
"time"
|
||||
|
||||
"gitlab.com/mstarongitlab/goutils/maputils"
|
||||
"gitlab.com/mstarongitlab/goutils/sliceutils"
|
||||
)
|
||||
|
||||
|
|
87
nsMasto.go
87
nsMasto.go
|
@ -1 +1,88 @@
|
|||
package goap
|
||||
|
||||
type DevicesData struct {
|
||||
FullIdType
|
||||
}
|
||||
|
||||
func (actor *DevicesData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return actor.FullIdType.GetSelfOrBase()
|
||||
}
|
||||
|
||||
func (actor *DevicesData) MarshalToMap() map[string]any {
|
||||
return actor.FullIdType.MarshalToMapWithName(KEY_MASTO_DEVICES)
|
||||
}
|
||||
|
||||
type DiscoverableData struct {
|
||||
Next BaseApChain
|
||||
Value ValueValue[bool]
|
||||
}
|
||||
|
||||
func (namedata *DiscoverableData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return namedata.Next, true
|
||||
}
|
||||
|
||||
func (namedata *DiscoverableData) MarshalToMap() map[string]any {
|
||||
return appendWithKey(
|
||||
namedata.Next.MarshalToMap(),
|
||||
KEY_MASTO_DISCOVERABLE,
|
||||
[]map[string]any{namedata.Value.Marshal()},
|
||||
)
|
||||
}
|
||||
|
||||
type FeaturedData struct {
|
||||
FullIdType
|
||||
}
|
||||
|
||||
func (actor *FeaturedData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return actor.FullIdType.GetSelfOrBase()
|
||||
}
|
||||
|
||||
func (actor *FeaturedData) MarshalToMap() map[string]any {
|
||||
return actor.FullIdType.MarshalToMapWithName(KEY_MASTO_FEATURED)
|
||||
}
|
||||
|
||||
type FeaturedTagsData struct {
|
||||
FullIdType
|
||||
}
|
||||
|
||||
func (actor *FeaturedTagsData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return actor.FullIdType.GetSelfOrBase()
|
||||
}
|
||||
|
||||
func (actor *FeaturedTagsData) MarshalToMap() map[string]any {
|
||||
return actor.FullIdType.MarshalToMapWithName(KEY_MASTO_FEATURED_TAGS)
|
||||
}
|
||||
|
||||
type IndexableData struct {
|
||||
Next BaseApChain
|
||||
Value ValueValue[bool]
|
||||
}
|
||||
|
||||
func (namedata *IndexableData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return namedata.Next, true
|
||||
}
|
||||
|
||||
func (namedata *IndexableData) MarshalToMap() map[string]any {
|
||||
return appendWithKey(
|
||||
namedata.Next.MarshalToMap(),
|
||||
KEY_MASTO_INDEXABLE,
|
||||
[]map[string]any{namedata.Value.Marshal()},
|
||||
)
|
||||
}
|
||||
|
||||
type MemorialData struct {
|
||||
Next BaseApChain
|
||||
Value ValueValue[bool]
|
||||
}
|
||||
|
||||
func (namedata *MemorialData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return namedata.Next, true
|
||||
}
|
||||
|
||||
func (namedata *MemorialData) MarshalToMap() map[string]any {
|
||||
return appendWithKey(
|
||||
namedata.Next.MarshalToMap(),
|
||||
KEY_MASTO_MEMORIAL,
|
||||
[]map[string]any{namedata.Value.Marshal()},
|
||||
)
|
||||
}
|
||||
|
|
13
nsW3.go
13
nsW3.go
|
@ -1 +1,14 @@
|
|||
package goap
|
||||
|
||||
// inbox
|
||||
type InboxData struct {
|
||||
FullIdType
|
||||
}
|
||||
|
||||
func (actor *InboxData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return actor.FullIdType.GetSelfOrBase()
|
||||
}
|
||||
|
||||
func (actor *InboxData) MarshalToMap() map[string]any {
|
||||
return actor.FullIdType.MarshalToMapWithName(KEY_W3_INBOX)
|
||||
}
|
||||
|
|
|
@ -1 +1,52 @@
|
|||
package goap
|
||||
|
||||
// Owner
|
||||
type OwnerData struct {
|
||||
FullIdType
|
||||
}
|
||||
|
||||
func (actor *OwnerData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return actor.FullIdType.GetSelfOrBase()
|
||||
}
|
||||
|
||||
func (actor *OwnerData) MarshalToMap() map[string]any {
|
||||
return actor.FullIdType.MarshalToMapWithName(KEY_W3_SECURITY_OWNER)
|
||||
}
|
||||
|
||||
type PublicKeyData struct {
|
||||
Next BaseApChain
|
||||
Id string
|
||||
Owner string
|
||||
Key string
|
||||
}
|
||||
|
||||
func (publickeydata *PublicKeyData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return publickeydata.Next, true
|
||||
}
|
||||
|
||||
func (publickeydata *PublicKeyData) MarshalToMap() map[string]any {
|
||||
m := publickeydata.Next.MarshalToMap()
|
||||
m[KEY_W3_SECURITY_PUBLICKEY] = []map[string]any{{
|
||||
KEY_ID: publickeydata.Id,
|
||||
KEY_W3_SECURITY_OWNER: []map[string]any{{KEY_ID: publickeydata.Owner}},
|
||||
KEY_W3_SECURITY_PUBLICKEYPEM: []map[string]any{{KEY_VALUE: publickeydata.Key}},
|
||||
}}
|
||||
return m
|
||||
}
|
||||
|
||||
type PublicKeyPemData struct {
|
||||
Next BaseApChain
|
||||
Value ValueValue[bool]
|
||||
}
|
||||
|
||||
func (namedata *PublicKeyPemData) GetSelfOrBase() (BaseApChain, bool) {
|
||||
return namedata.Next, true
|
||||
}
|
||||
|
||||
func (namedata *PublicKeyPemData) MarshalToMap() map[string]any {
|
||||
return appendWithKey(
|
||||
namedata.Next.MarshalToMap(),
|
||||
KEY_W3_SECURITY_PUBLICKEYPEM,
|
||||
[]map[string]any{namedata.Value.Marshal()},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue