entity

package
v2.0.0-...-4e8a7ef Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
}

func (App) Name

func (a App) Name() string

func (App) Priority

func (a App) Priority() application.Priority

func (App) Register

func (a App) Register() error

func (App) Router

func (a App) Router() error

func (App) WhenReady

func (a App) WhenReady() error

type DataSource

type DataSource struct {
	Type       Type                        `json:"type"`
	URL        *string                     `json:"url,omitempty"`
	Preload    bool                        `json:"preload"`
	Dictionary *types.Dictionary[any, any] `json:"dictionary,omitempty"`
	Mapper     *Mapper                     `json:"mapper,omitempty"`
	Entry      *string                     `json:"entry,omitempty"`
}

type Entity

type Entity struct {
	EntitySlug string                  `gorm:"column:entity_slug;size:32;primaryKey" json:"entity_slug"`
	Table      string                  `gorm:"column:table;size:32;unique"  json:"table"`
	Name       string                  `gorm:"column:name;size:64"  json:"name"`
	Package    string                  `gorm:"column:package;size:64" json:"package"`
	PrimaryKey types.JSONSlice[string] `gorm:"column:primary_key;type:varchar(512)" json:"primary_key"`
	Schema     schema.Model            `gorm:"-" json:"-"`
	Instance   interface{}             `gorm:"-" json:"-"`
}

func (Entity) TableName

func (Entity) TableName() string

type Field

type Field struct {
	FieldSlug  string                     `gorm:"column:field_slug;size:128;primaryKey" json:"field_slug"`
	PrimaryKey bool                       `gorm:"column:primary_key" json:"primary_key"`
	EntitySlug string                     `gorm:"column:entity_slug;size:32;fk:entity" json:"entity_slug"`
	Entity     Entity                     `gorm:"foreignKey:EntitySlug;references:EntitySlug" json:"entity"`
	FieldName  string                     `gorm:"column:field_name;size:64" json:"field_name"`
	JSONTag    string                     `gorm:"column:json_tag;size:64"  json:"json_tag"`
	DBField    string                     `gorm:"column:db_field;size:64" json:"db_field"`
	Type       string                     `gorm:"column:type;size:255" json:"type"`
	DBType     string                     `gorm:"column:db_type;size:64" json:"db_type"`
	DataSource types.JSONType[DataSource] `gorm:"column:data_source;nullable;type:text" json:"data_source"`
}

func (Field) TableName

func (Field) TableName() string

type FieldOption

type FieldOption struct {
	Key         string `gorm:"column:key;primaryKey;size:32" json:"key"`
	Label       string `gorm:"column:label;size:128" json:"label"`
	Description string `gorm:"column:description;size:512" json:"description"`
	Icon        string `gorm:"column:icon;size:64" json:"icon"`
	Image       string `gorm:"column:image;size:255" json:"image"`
	FieldSlug   string `gorm:"column:field_slug;size:128;fk:entity_field" json:"field_slug"`
	EntityField *Field `gorm:"foreignKey:FieldSlug" json:"entity_field,omitempty"`
	ClassName   string `gorm:"column:class_name;size:255" json:"class_name"`
	VisualOrder int    `gorm:"column:visual_order" json:"visual_order"`
	restify.API
}

func (FieldOption) TableName

func (FieldOption) TableName() string

type Mapper

type Mapper struct {
	Iterator string            `json:"iterator"`
	Map      map[string]string `json:"map"`
}

type Option

type Option string

func (Option) ColumnDefinition

func (o Option) ColumnDefinition(column *ddl.Column)

type Type

type Type string
const (
	TypeNotAssigned Type = "NA"
	TypeAPI         Type = "API"
	TypeDictionary  Type = "dictionary"
)

Jump to

Keyboard shortcuts

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