list

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Lists map[string]*DSL = map[string]*DSL{}

Lists the loaded list widgets

Functions

func Export

func Export() error

Export process & api

func Guard

func Guard(c *gin.Context)

Guard list widget guard

func Load

func Load(cfg config.Config) error

Load load task

func LoadAndExport

func LoadAndExport(cfg config.Config) error

LoadAndExport load list

func LoadFile

func LoadFile(root string, file string) error

LoadFile load table dsl by file

func LoadID

func LoadID(id string, root string) error

LoadID load via id

Types

type ActionDSL

type ActionDSL struct {
	Bind       *BindActionDSL  `json:"bind,omitempty"`
	Setting    *action.Process `json:"setting,omitempty"`
	Component  *action.Process `json:"component,omitempty"`
	Upload     *action.Process `json:"upload,omitempty"`
	Download   *action.Process `json:"download,omitempty"`
	Get        *action.Process `json:"get,omitempty"`
	Save       *action.Process `json:"save,omitempty"`
	BeforeGet  *hook.Before    `json:"before:find,omitempty"`
	AfterGet   *hook.After     `json:"after:find,omitempty"`
	BeforeSave *hook.Before    `json:"before:save,omitempty"`
	AfterSave  *hook.After     `json:"after:save,omitempty"`
}

ActionDSL the list action DSL

func (*ActionDSL) BindModel

func (act *ActionDSL) BindModel(m *model.Model) error

BindModel bind model

func (*ActionDSL) BindTable

func (act *ActionDSL) BindTable(tab *table.DSL) error

BindTable bind table

func (*ActionDSL) SetDefaultProcess

func (act *ActionDSL) SetDefaultProcess()

SetDefaultProcess set the default value of action

type BindActionDSL

type BindActionDSL struct {
	Model  string                 `json:"model,omitempty"`  // bind model
	Store  string                 `json:"store,omitempty"`  // bind store
	Table  string                 `json:"table,omitempty"`  // bind table
	Option map[string]interface{} `json:"option,omitempty"` // bind option
}

BindActionDSL action.bind

type DSL

type DSL struct {
	ID     string                 `json:"id,omitempty"`
	Root   string                 `json:"-"`
	Name   string                 `json:"name,omitempty"`
	Action *ActionDSL             `json:"action"`
	Layout *LayoutDSL             `json:"layout"`
	Fields *FieldsDSL             `json:"fields"`
	Config map[string]interface{} `json:"config,omitempty"`
	CProps field.CloudProps       `json:"-"`
	compute.Computable
	*mapping.Mapping
}

DSL the list DSL

func Get

func Get(list interface{}) (*DSL, error)

Get list via process or id

func MustGet

func MustGet(list interface{}) *DSL

MustGet Get list via process or id thow error

func New

func New(id string) *DSL

New create a new DSL

func (*DSL) Bind

func (dsl *DSL) Bind() error

Bind model / store / table / ...

func (*DSL) Validate

func (dsl *DSL) Validate() error

Validate table

func (*DSL) Xgen

func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map[string]interface{}, error)

Xgen trans to xgen setting

type FieldsDSL

type FieldsDSL struct {
	List field.Columns `json:"list,omitempty"`
	// contains filtered or unexported fields
}

FieldsDSL the list fields DSL

func (*FieldsDSL) BindModel

func (fields *FieldsDSL) BindModel(m *model.Model) error

BindModel bind model

func (*FieldsDSL) BindTable

func (fields *FieldsDSL) BindTable(tab *table.DSL) error

BindTable bind table

func (*FieldsDSL) Xgen

func (fields *FieldsDSL) Xgen(layout *LayoutDSL) (map[string]interface{}, error)

Xgen trans to xgen setting

type LayoutDSL

type LayoutDSL struct {
	List   *ViewLayoutDSL         `json:"list,omitempty"`
	Config map[string]interface{} `json:"config,omitempty"`
}

LayoutDSL the list layout DSL

func (*LayoutDSL) BindModel

func (layout *LayoutDSL) BindModel(m *model.Model, listID string, fields *FieldsDSL, option map[string]interface{})

BindModel bind model

func (*LayoutDSL) BindTable

func (layout *LayoutDSL) BindTable(tab *table.DSL, listID string, fields *FieldsDSL) error

BindTable bind table

func (*LayoutDSL) Clone

func (layout *LayoutDSL) Clone() (*LayoutDSL, error)

Clone layout for output

func (*LayoutDSL) Xgen

func (layout *LayoutDSL) Xgen(data map[string]interface{}, excludes map[string]bool, mapping *mapping.Mapping) (*LayoutDSL, error)

Xgen trans to Xgen setting

type OperationLayoutDSL

type OperationLayoutDSL struct {
	Preset  map[string]map[string]interface{} `json:"preset,omitempty"`
	Actions []component.ActionDSL             `json:"actions,omitempty"`
}

OperationLayoutDSL layout.operation

type ViewLayoutDSL

type ViewLayoutDSL struct {
	Props   component.PropsDSL      `json:"props,omitempty"`
	Columns []component.InstanceDSL `json:"columns,omitempty"`
}

ViewLayoutDSL layout.list

Jump to

Keyboard shortcuts

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