feat: add meta MetadataParentLink
This commit is contained in:
parent
36c4212305
commit
93782c9db7
|
@ -0,0 +1,24 @@
|
||||||
|
package metadata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
||||||
|
"git.lumeweb.com/LumeWeb/libs5-go/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MetadataParentLink represents the structure for Metadata Parent Link.
|
||||||
|
type MetadataParentLink struct {
|
||||||
|
CID *encoding.CID
|
||||||
|
Type types.ParentLinkType
|
||||||
|
Role string
|
||||||
|
Signed bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMetadataParentLink creates a new MetadataParentLink with the provided values.
|
||||||
|
func NewMetadataParentLink(cid *encoding.CID, role string, signed bool) *MetadataParentLink {
|
||||||
|
return &MetadataParentLink{
|
||||||
|
CID: cid,
|
||||||
|
Type: types.ParentLinkTypeUserIdentity,
|
||||||
|
Role: role,
|
||||||
|
Signed: signed,
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package types
|
||||||
|
|
||||||
|
type ParentLinkType int
|
||||||
|
|
||||||
|
const (
|
||||||
|
ParentLinkTypeUserIdentity ParentLinkType = 0x01
|
||||||
|
ParentLinkTypeBoard ParentLinkType = 0x05
|
||||||
|
ParentLinkTypeBridgeUser ParentLinkType = 0x0A
|
||||||
|
)
|
||||||
|
|
||||||
|
var ParentLinkTypeMap = map[ParentLinkType]string{
|
||||||
|
ParentLinkTypeUserIdentity: "UserIdentity",
|
||||||
|
ParentLinkTypeBoard: "Board",
|
||||||
|
ParentLinkTypeBridgeUser: "BridgeUser",
|
||||||
|
}
|
Loading…
Reference in New Issue