schema

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID         uint            `json:"id"`                     // Node ID
	UUID       string          `json:"uuid"`                   // UUID
	Primitive  string          `json:"primitive"`              // Primitive Slug
	UID        int             `json:"uid" binding:"required"` // User ID
	Slug       string          `json:"slug"`                   // Slug short machine name
	Status     int             `json:"status"`                 // Node status (Published: 1, Draft: 0)
	Parent     string          `json:"parent"`                 // Parent
	ParentPath string          `json:"parent_path"`            // Parent path
	References json.RawMessage `json:"references"`             // References in JSON Format with reference fields and Primitives
	CreatedAt  time.Time       `json:"created_at"`             // Creation time
	UpdatedAt  time.Time       `json:"updated_at"`             // Updated time
	NodeBodies NodeBodies      `json:"variations"`             // Node Body with Languages
}

Node - Node object

type NodeBodies

type NodeBodies []*NodeBody

PermissionActions - Permission action list

type NodeBody

type NodeBody struct {
	NID       string    `json:"nid"`                         // Node Slug
	UID       int       `json:"uid"`                         // User ID
	Lang      string    `json:"language" binding:"required"` // Language Code Identifier
	Title     string    `json:"title" binding:"required"`    // Node Title
	Body      string    `json:"body"`                        // Node Body
	CreatedAt time.Time `json:"created_at"`                  // Creation time
	UpdatedAt time.Time `json:"updated_at"`                  // Updated time
}

Node Body - Node Body object

type NodeQueryOptions

type NodeQueryOptions struct {
	PageParam         *schema.PaginationParam // Paging parameter
	IncludeNodeBodies bool                    // Contains Node Bodies List
}

NodeQueryOptions - Node object query optional parameter item

type NodeQueryParam

type NodeQueryParam struct {
	UUIDs            []string // UUID list
	UID              int      // User ID, Creator
	Slug             string   // Short machine name
	Primitive        string   // Primitive Slug
	Slugs            []string // Slug list
	Lang             string   // Language of body
	Title            string   // Title
	Parent           *string  // Parent ID
	PrefixParentPath string   // Parent path (prefix fuzzy query)
	LikeSlug         string   // Slug (fuzzy query)
}

NodeQueryParam - Query conditions

type NodeQueryResult

type NodeQueryResult struct {
	Data       Nodes
	PageResult *schema.PaginationResult
}

NodeQueryResult - Node object query result

type NodeTree

type NodeTree struct {
	ID         uint            `json:"id"`
	UUID       string          `json:"uuid"`                         // Record UUID
	UID        int             `json:"uid" binding:"required"`       // User ID
	Primitive  string          `json:"primitive" binding:"required"` // Primitive Slug
	Slug       string          `json:"slug"`                         // Sort value
	Parent     string          `json:"parent"`                       // Permission icon
	ParentPath string          `json:"parent_path"`                  // Access routing
	Status     int             `json:"status"`                       // Status (0: not published 1: published)
	NodeBodies NodeBodies      `json:"variations"`                   // Node Language Bodies
	References json.RawMessage `json:"references"`                   // References to fields or other Nodes
	CreatedAt  time.Time       `json:"created_at"`                   // Created Time
	UpdatedAt  time.Time       `json:"updated_at"`                   // Updated Time
	Children   *[]*NodeTree    `json:"children,omitempty"`           // Child tree
}

PermissionTree - Permission tree

type NodeTrees

type NodeTrees []*NodeTree

PermissionTrees - Node Tree list

func (NodeTrees) ForEach

func (a NodeTrees) ForEach(fn func(*NodeTree, int)) NodeTrees

ForEach - Through the data entry

func (NodeTrees) ToTree

func (a NodeTrees) ToTree() []*NodeTree

ToTree - Convert to tree structure

type Nodes

type Nodes []*Node

Nodes - Node list

func (Nodes) SplitAndGetAllSlugs

func (a Nodes) SplitAndGetAllSlugs() []string

SplitAndGetAllSlugs - Split parent path and get all Slugs

func (Nodes) ToLeafSlugs

func (a Nodes) ToLeafSlugs() []string

ToLeafSlugs - Convert to leaf node record ID list

func (Nodes) ToMap

func (a Nodes) ToMap() map[string]*Node

ToMap - Convert to key-value mapping

func (Nodes) ToTrees

func (a Nodes) ToTrees() NodeTrees

ToTrees - Convert to Permission list

type Primitive

type Primitive struct {
	ID         uint            `json:"id"`                        // Primitive ID
	UUID       string          `json:"uuid"`                      // UUID
	UID        int             `json:"uid" binding:"required"`    // User ID
	Slug       string          `json:"slug" binding:"required"`   // Slug short machine name
	Parent     string          `json:"parent" binding:"required"` // Parent
	ParentPath string          `json:"parent_path"`               // Parent path
	Options    json.RawMessage `json:"options"`                   // Options in Jeson Format
	CreatedAt  time.Time       `json:"created_at"`                // Creation time
	UpdatedAt  time.Time       `json:"updated_at"`                // Updated time
	Variations Variations      `json:"variations"`                // Primitive Body with Languages
}

Primitive - Primitive object

type PrimitiveBody

type PrimitiveBody struct {
	Slug      string    `json:"slug"`                        // Primitive Slug
	UID       int       `json:"uid"`                         // User ID
	Lang      string    `json:"language" binding:"required"` // Language Code Identifier
	Title     string    `json:"title" binding:"required"`    // Primitive Title
	Body      string    `json:"body"`                        // Primitive Body
	CreatedAt time.Time `json:"created_at"`                  // Creation time
	UpdatedAt time.Time `json:"updated_at"`                  // Updated time
}

Primitive Body - Primitive Body object

type PrimitiveQueryOptions

type PrimitiveQueryOptions struct {
	PageParam         *schema.PaginationParam // Paging parameter
	IncludeVariations bool                    // Contains action list
}

PrimitiveQueryOptions - Primitive object query optional parameter item

type PrimitiveQueryParam

type PrimitiveQueryParam struct {
	UUIDs            []string // UUID list
	UID              int      // User ID, Creator
	Slug             string   // Slug list
	Slugs            []string // Slug list
	Lang             string   // Language of body
	Title            string   // Title
	Parent           *string  // Parent ID
	PrefixParentPath string   // Parent path (prefix fuzzy query)
	LikeSlug         string   // Slug (fuzzy query)
}

PrimitiveQueryParam - Query conditions

type PrimitiveQueryResult

type PrimitiveQueryResult struct {
	Data       Primitives
	PageResult *schema.PaginationResult
}

PrimitiveQueryResult - Primitive object query result

type PrimitiveTree

type PrimitiveTree struct {
	ID         uint              `json:"id"`
	UUID       string            `json:"uuid"`                   // Record UUID
	UID        int               `json:"uid" binding:"required"` // User ID
	Slug       string            `json:"slug"`                   // Sort value
	Parent     string            `json:"parent"`                 // Permission icon
	ParentPath string            `json:"parent_path"`            // Access routing
	Options    json.RawMessage   `json:"options"`                // Hide Permission (0: don't hide 1: hide)
	CreatedAt  time.Time         `json:"created_at"`             // Parent ID
	UpdatedAt  time.Time         `json:"updated_at"`             // Parent path
	Variations Variations        `json:"variations"`             // Resource list           // Action list
	Children   *[]*PrimitiveTree `json:"children,omitempty"`     // Child tree
}

PermissionTree - Permission tree

type PrimitiveTrees

type PrimitiveTrees []*PrimitiveTree

PermissionTrees - Primitive Tree list

func (PrimitiveTrees) ForEach

func (a PrimitiveTrees) ForEach(fn func(*PrimitiveTree, int)) PrimitiveTrees

ForEach - Through the data entry

func (PrimitiveTrees) ToTree

func (a PrimitiveTrees) ToTree() []*PrimitiveTree

ToTree - Convert to tree structure

type Primitives

type Primitives []*Primitive

Primitives - Primitive list

func (Primitives) SplitAndGetAllSlugs

func (a Primitives) SplitAndGetAllSlugs() []string

SplitAndGetAllSlugs - Split parent path and get all Slugs

func (Primitives) ToLeafSlugs

func (a Primitives) ToLeafSlugs() []string

ToLeafSlugs - Convert to leaf node record ID list

func (Primitives) ToMap

func (a Primitives) ToMap() map[string]*Primitive

ToMap - Convert to key-value mapping

func (Primitives) ToTrees

func (a Primitives) ToTrees() PrimitiveTrees

ToTrees - Convert to Permission list

type Variations

type Variations []*PrimitiveBody

PermissionActions - Permission action list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL