Documentation ¶
Overview ¶
Copyright 2022. Motty Cohen
Entity interface and base entity for all persistent model entities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseEntity ¶
type BaseEntity struct { Id string `json:"id"` // Unique object Id Key string `json:"key"` // Shard (tenant) key CreatedOn Timestamp `json:"createdOn"` // When the object was created [Epoch milliseconds Timestamp] UpdatedOn Timestamp `json:"updatedOn"` // When the object was last updated [Epoch milliseconds Timestamp] }
*
- Base structure for Entity
func (BaseEntity) ID ¶
func (e BaseEntity) ID() string
func (BaseEntity) KEY ¶
func (e BaseEntity) KEY() string
func (BaseEntity) NAME ¶
func (e BaseEntity) NAME() string
func (BaseEntity) TABLE ¶
func (e BaseEntity) TABLE() string
type Entity ¶
type Entity interface { // Return the entity unique Id ID() string // Return the entity table name (for sharded entities, table name include the suffix of the tenant id) TABLE() string // Get entity name NAME() string // Get entity shard key (tenant id) KEY() string }
region Entity Interface --------------------------------------------------------------------------------------------- *
- Mark all concrete DB entities
type EntityAction ¶
type EntityAction int
const ( AddEntity EntityAction = 1 UpdateEntity EntityAction = 2 DeleteEntity EntityAction = 3 )
Click to show internal directories.
Click to hide internal directories.