component

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat(args ...interface{}) (interface{}, error)

Concat string

func Download

func Download(args ...interface{}) (interface{}, error)

Download return the file download path

func Export

func Export() error

Export processes

func Get

func Get(args ...interface{}) (interface{}, error)

Get value

func Hide

func Hide(args ...interface{}) (interface{}, error)

Hide value

func Trim

func Trim(args ...interface{}) (interface{}, error)

Trim string

func Upload

func Upload(args ...interface{}) (interface{}, error)

Upload return the file download path

Types

type ActionDSL

type ActionDSL struct {
	ID           string            `json:"id,omitempty"`
	Title        string            `json:"title,omitempty"`
	Width        int               `json:"width,omitempty"`
	Icon         string            `json:"icon,omitempty"`
	Style        string            `json:"style,omitempty"`
	Xpath        string            `json:"xpath,omitempty"`
	DivideLine   bool              `json:"divideLine,omitempty"`
	Hide         []string          `json:"hide,omitempty"` // Syntactic sugar ["add", "edit", "view"]
	ShowWhenAdd  bool              `json:"showWhenAdd,omitempty"`
	ShowWhenView bool              `json:"showWhenView,omitempty"`
	HideWhenEdit bool              `json:"hideWhenEdit,omitempty"`
	Props        PropsDSL          `json:"props,omitempty"`
	Confirm      *ConfirmActionDSL `json:"confirm,omitempty"`
	Action       ActionNodes       `json:"action,omitempty"`
	Disabled     *DisabledDSL      `json:"disabled,omitempty"`
}

ActionDSL the component action DSL

func (ActionDSL) Hash added in v0.10.3

func (action ActionDSL) Hash() (string, error)

Hash hash value

func (*ActionDSL) UnmarshalJSON added in v0.10.3

func (action *ActionDSL) UnmarshalJSON(data []byte) error

UnmarshalJSON for json UnmarshalJSON

type ActionNode added in v0.10.3

type ActionNode map[string]interface{}

ActionNode the action node

func (ActionNode) Custom added in v0.10.3

func (node ActionNode) Custom() bool

Custom check if the action node is custom

type ActionNodes added in v0.10.3

type ActionNodes []ActionNode

ActionNodes the action nodes

func (*ActionNodes) Parse added in v0.10.3

func (nodes *ActionNodes) Parse() error

Parse the custom nodes

func (*ActionNodes) UnmarshalJSON added in v0.10.3

func (nodes *ActionNodes) UnmarshalJSON(data []byte) error

UnmarshalJSON for json UnmarshalJSON

type Actions

type Actions []ActionDSL

Actions the actions

func (Actions) Filter added in v0.10.3

func (actions Actions) Filter(excludes map[string]bool) Actions

Filter actions

type ActionsExport added in v0.10.3

type ActionsExport struct {
	Type    string  `json:"type,omitempty"`
	Xpath   string  `json:"xpath"`
	Actions Actions `json:"actions,omitempty"`
}

ActionsExport the export actions

type CArg

type CArg struct {
	IsExp bool
	// contains filtered or unexported fields
}

CArg compute interface{}

func NewExp

func NewExp(key string) CArg

NewExp create a new exp CArg

func (CArg) MarshalJSON

func (arg CArg) MarshalJSON() ([]byte, error)

MarshalJSON for JSON parse

func (*CArg) UnmarshalJSON

func (arg *CArg) UnmarshalJSON(data []byte) error

UnmarshalJSON for JSON parse

func (CArg) Value

func (arg CArg) Value(data maps.MapStr) interface{}

Value compute arg value

type CloudPropsDSL

type CloudPropsDSL struct {
	Xpath   string                 `json:"xpath,omitempty"`
	Type    string                 `json:"type,omitempty"`
	Name    string                 `json:"name,omitempty"`
	Process string                 `json:"process,omitempty"`
	Query   map[string]interface{} `json:"query,omitempty"`
}

CloudPropsDSL the cloud props

func (CloudPropsDSL) ExecQuery

func (cProp CloudPropsDSL) ExecQuery(process *gouProcess.Process, query map[string]interface{}) (interface{}, error)

ExecQuery execute query

func (CloudPropsDSL) ExecUpload

func (cProp CloudPropsDSL) ExecUpload(process *gouProcess.Process, upload types.UploadFile) (interface{}, error)

ExecUpload execute upload

func (*CloudPropsDSL) Parse

func (cProp *CloudPropsDSL) Parse(v interface{}) error

Parse parse cloud props

func (CloudPropsDSL) Path

func (cProp CloudPropsDSL) Path() string

Path api path

func (CloudPropsDSL) Replace

func (cProp CloudPropsDSL) Replace(data interface{}, replace func(cProp CloudPropsDSL) interface{}) error

Replace xpath

func (CloudPropsDSL) UploadPath

func (cProp CloudPropsDSL) UploadPath() string

UploadPath api UploadPath

type Compute

type Compute struct {
	Process string `json:"process"`
	Args    []CArg `json:"args,omitempty"`
}

Compute process

func (*Compute) GetArgs

func (compute *Compute) GetArgs(data maps.MapStr) []interface{}

GetArgs return args

func (Compute) MarshalJSON

func (compute Compute) MarshalJSON() ([]byte, error)

MarshalJSON Custom JSON parse

func (*Compute) UnmarshalJSON

func (compute *Compute) UnmarshalJSON(data []byte) error

UnmarshalJSON Custom JSON parse

func (*Compute) Value

func (compute *Compute) Value(data maps.MapStr, sid string, global map[string]interface{}) (interface{}, error)

Value compute value

type ComputeHanlder

type ComputeHanlder func(args ...interface{}) (interface{}, error)

ComputeHanlder computeHanlder

type ConfirmActionDSL

type ConfirmActionDSL struct {
	Title string `json:"title,omitempty"`
	Desc  string `json:"desc,omitempty"`
}

ConfirmActionDSL action.confirm

type DSL

type DSL struct {
	Bind    string   `json:"bind,omitempty"`
	Type    string   `json:"type,omitempty"`
	Compute *Compute `json:"compute,omitempty"`
	Props   PropsDSL `json:"props,omitempty"`
}

DSL the component DSL

func (*DSL) Clone

func (dsl *DSL) Clone() *DSL

Clone Component

func (DSL) Map

func (dsl DSL) Map() map[string]interface{}

Map cast to map[string]interface{}

func (DSL) MarshalJSON

func (dsl DSL) MarshalJSON() ([]byte, error)

MarshalJSON Custom JSON parse

type DisabledDSL added in v0.10.3

type DisabledDSL struct {
	Field string      `json:"Field,omitempty"` //  Syntactic sugar -> bind
	Bind  string      `json:"bind,omitempty"`
	Eq    interface{} `json:"eq,omitempty"`    // string | array<string>  Syntactic sugar eq -> value
	Equal interface{} `json:"equal,omitempty"` // string | array<string>  Syntactic sugar equal -> value
	Value interface{} `json:"value,omitempty"` // string | array<string>
}

DisabledDSL the action disabled

type InstanceDSL

type InstanceDSL struct {
	Name   string        `json:"name,omitempty"`
	Width  interface{}   `json:"width,omitempty"`
	Height interface{}   `json:"height,omitempty"`
	Fixed  bool          `json:"fixed,omitempty"` // for widget table
	Rows   []InstanceDSL `json:"rows,omitempty"`
}

InstanceDSL the component instance DSL

type Instances

type Instances []InstanceDSL

Instances the Instances

type PropsDSL

type PropsDSL map[string]interface{}

PropsDSL component props

func (PropsDSL) CloudProps

func (p PropsDSL) CloudProps(xpath, component string) (map[string]CloudPropsDSL, error)

CloudProps parse CloudProps

Jump to

Keyboard shortcuts

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