Documentation ¶
Index ¶
- func GetNodeBodyDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetNodeDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetPrimitiveBodyDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetPrimitiveDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- type Node
- type NodeBodies
- type NodeBody
- type Nodes
- type Primitive
- type PrimitiveBody
- type Primitives
- type SchemaNode
- type SchemaNodeBody
- type SchemaPrimitive
- type SchemaPrimitiveBody
- type Variations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNodeBodyDB ¶
GetNodeDB - Get the Node store
func GetPrimitiveBodyDB ¶
GetPrimitiveDB - Get the Primitive store
Types ¶
type Node ¶
type Node struct { entity.Model UUID string `gorm:"column:uuid;size:36;index;"` // UUID User account.User `gorm:"foreignkey:UID;association_foreignkey:ID"` // Creator User ID UID int `gorm:"column:uid;"` // Creator User ID Primitive string `gorm:"column:primitive;size:100;"` // Primitive Slug Slug string `gorm:"column:slug;size:100;unique_index;"` // Slug short machine name Parent string `gorm:"column:parent;size:100;unique_index;"` // Slug short machine name ParentPath string `gorm:"column:parent_path"` // Parent path Status int `gorm:"column:status"` // Staus (1: published, 0: unpublished) References json.RawMessage `gorm:"column:references;type:jsonb;"` // References in JSON Format NodeBodies NodeBodies }
Node - Node entity
func (Node) ToSchemaNode ¶
ToSchemaNode - Convert to Node object
type NodeBodies ¶
type NodeBodies []*NodeBody
NodeBodies - NodeBody lassociated entity ist
func (NodeBodies) GetByNodeID ¶
func (a NodeBodies) GetByNodeID(UUID string) []*schema.NodeBody
GetByNodeID - Get Node Body list based on Node ID
func (NodeBodies) ToMap ¶
func (a NodeBodies) ToMap() map[string]*NodeBody
ToMap - Convert to key-value mapping
func (NodeBodies) ToSchemaNodeBodies ¶
func (a NodeBodies) ToSchemaNodeBodies() []*schema.NodeBody
ToSchemaNodeBodies - Convert to Node Body variations action list
type NodeBody ¶
type NodeBody struct { Node Node `gorm:"foreignkey:Slug;association_foreignkey:Slug"` // Node ID NID string `gorm:"column:nid"` // Node ID User account.User `gorm:"foreignkey:UID;association_foreignkey:ID"` // Creator User ID UID int `gorm:"column:uid;"` // Creator User ID Language i18n.Language `gorm:"foreignkey:Lang;association_foreignkey:Code"` // Language Code Identifieru se Code as foreign key Lang string `gorm:"column:language"` // Language Code Identifieru se Code as foreign key Title *string `gorm:"column:title" binding:"required"` // Node Title Body *string `gorm:"column:body"` // Node Body CreatedAt time.Time `gorm:"column:created_at"` // Creation time UpdatedAt time.Time `gorm:"column:updated_at"` // Updated time }
Node Body - Node Body object
func (NodeBody) ToSchemaNodeBody ¶
ToSchemaNodeBody - Convert to Node Body object
type Nodes ¶
type Nodes []*Node
Nodes - Node list
func (Nodes) ToSchemaNodes ¶
ToSchemaNodes - Convert to Node object list
type Primitive ¶
type Primitive struct { entity.Model UUID string `gorm:"column:uuid;size:36;index;"` // UUID User account.User `gorm:"foreignkey:UID;association_foreignkey:ID"` // Creator User ID UID int `gorm:"column:uid;"` // Creator User ID Slug string `gorm:"column:slug;size:100;unique_index;"` // Slug short machine name Parent string `gorm:"column:parent;size:100;unique_index;"` // Slug short machine name ParentPath string `gorm:"column:parent_path"` // Parent path Options json.RawMessage `gorm:"column:options;type:jsonb;"` // Options in Jeson Format Variations Variations }
Primitive - Primitive entity
func (Primitive) ToSchemaPrimitive ¶
ToSchemaPrimitive - Convert to Primitive object
type PrimitiveBody ¶
type PrimitiveBody struct { Primitive Primitive `gorm:"foreignkey:Slug;association_foreignkey:Slug"` // Primitive ID Slug Slug string `gorm:"column:slug"` // Primitive ID Slug User account.User `gorm:"foreignkey:UID;association_foreignkey:ID"` // Creator User ID UID int `gorm:"column:uid;"` // Creator User ID Language i18n.Language `gorm:"foreignkey:Lang;association_foreignkey:Code"` // Language Code Identifieru se Code as foreign key Lang string `gorm:"column:language"` // Language Code Identifieru se Code as foreign key Title *string `gorm:"column:title" binding:"required"` // Primitive Title Body *string `gorm:"column:body"` // Primitive Body CreatedAt time.Time `gorm:"column:created_at"` // Creation time UpdatedAt time.Time `gorm:"column:updated_at"` // Updated time }
Primitive Body - Primitive Body object
func (PrimitiveBody) ToSchemaPrimitiveBody ¶
func (a PrimitiveBody) ToSchemaPrimitiveBody() *schema.PrimitiveBody
ToSchemaPrimitiveBody - Convert to Primitive Body object
type Primitives ¶
type Primitives []*Primitive
Primitives - Primitive list
func (Primitives) ToSchemaPrimitives ¶
func (a Primitives) ToSchemaPrimitives() []*schema.Primitive
ToSchemaPrimitives - Convert to Primitive object list
type SchemaNode ¶
SchemaNode - Node object
func (SchemaNode) ToNodeBodies ¶
func (a SchemaNode) ToNodeBodies() []*NodeBody
ToPermissionActions - Convert to permission action list
type SchemaNodeBody ¶
SchemaNodeBody NodeBody action object
func (SchemaNodeBody) ToNodeBody ¶
func (a SchemaNodeBody) ToNodeBody(NID string) *NodeBody
ToNodeBody - Convert to Node Body entity
type SchemaPrimitive ¶
SchemaPrimitive - Primitive object
func (SchemaPrimitive) ToPrimitive ¶
func (a SchemaPrimitive) ToPrimitive() *Primitive
ToPrimitive - Convert to Primitive entity
func (SchemaPrimitive) ToVariations ¶
func (a SchemaPrimitive) ToVariations() []*PrimitiveBody
ToPermissionActions - Convert to permission action list
type SchemaPrimitiveBody ¶
type SchemaPrimitiveBody schema.PrimitiveBody
SchemaPrimitiveBody PrimitiveBody action object
func (SchemaPrimitiveBody) ToPrimitiveBody ¶
func (a SchemaPrimitiveBody) ToPrimitiveBody(Slug string) *PrimitiveBody
ToPrimitiveBody - Convert to Primitive Body entity
type Variations ¶
type Variations []*PrimitiveBody
Variations - PrimitiveBody lassociated entity ist
func (Variations) GetByPrimitiveID ¶
func (a Variations) GetByPrimitiveID(Slug string) []*schema.PrimitiveBody
GetByPrimitiveID - Get Primitive Body list based on Primitive ID
func (Variations) ToMap ¶
func (a Variations) ToMap() map[string]*PrimitiveBody
ToMap - Convert to key-value mapping
func (Variations) ToSchemaVariations ¶
func (a Variations) ToSchemaVariations() []*schema.PrimitiveBody
ToSchemaVariations - Convert to Primitive Body variations action list