Documentation
¶
Index ¶
- Constants
- type Comp
- type Core
- func (c *Core) GetEntityID() contract.ID
- func (c *Core) GetOwners() []*contract.ID
- func (c *Core) GetReaders() []*contract.ID
- func (c *Core) GetWriters() []*contract.ID
- func (c *Core) SetEntityID(x contract.ID)
- func (c *Core) SetOwners(x []*contract.ID)
- func (c *Core) SetReaders(x []*contract.ID)
- func (c *Core) SetWriters(x []*contract.ID)
- type CoreOption
- type Entity
- type Meta
- type MetaOption
Constants ¶
View Source
const ( EntityIDKey = "entity_id" ReadersKey = "readers" WritersKey = "writers" OwnersKey = "owners" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
EntityID *contract.ID `json:"entity_id" validate:"nnpt,nz"`
Readers *[]*contract.ID `json:"readers" validate:"nnpt,nz"`
Writers *[]*contract.ID `json:"writers" validate:"nnpt,nz"`
Owners *[]*contract.ID `json:"owners" validate:"nnpt,nz"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetEntityID ¶
func (*Core) GetReaders ¶
func (*Core) GetWriters ¶
func (*Core) SetEntityID ¶
func (*Core) SetReaders ¶
func (*Core) SetWriters ¶
type CoreOption ¶
type CoreOption = contracti.CoreOption[Core]
func WithEntityID ¶
func WithEntityID(x contract.ID) CoreOption
func WithOwners ¶
func WithOwners(x []*contract.ID) CoreOption
func WithReaders ¶
func WithReaders(x []*contract.ID) CoreOption
func WithWriters ¶
func WithWriters(x []*contract.ID) CoreOption
type Entity ¶
type Entity struct {
Meta `bson:",inline" validate:"recurse"`
Comp `bson:",inline" validate:"recurse"`
Core `bson:",inline" validate:"recurse"`
}
Entity represents an entity with its authorization data.
type MetaOption ¶
type MetaOption = contract.MetaOption[Meta]
func WithCommon ¶
func WithCommon(x common.Common) MetaOption
Click to show internal directories.
Click to hide internal directories.