Documentation ¶
Index ¶
- Constants
- type Attribute
- func (attr *Attribute) Copy() *Attribute
- func (attr *Attribute) DisplayValue() string
- func (attr *Attribute) GetLabel() string
- func (attr *Attribute) GetLabelByLanguage(language string) string
- func (attr *Attribute) HasVisibility(visibility AttributeVisibility) bool
- func (attr *Attribute) Parse(value string) (any, error)
- func (attr *Attribute) SetErrorText(errorText string)
- func (attr *Attribute) SetValue(value any) error
- func (attr *Attribute) Value() any
- type AttributeVisibility
- type CustomAction
- type Db
- func (db *Db) BindObject(name string, createStruct func() any)
- func (db *Db) GetCustomAction(name string) *CustomAction
- func (db *Db) GetObject(name string) *PersistentObject
- func (db *Db) GetQuery(name string) *Query
- func (db *Db) Merge(other *Db)
- func (db *Db) NewCustomAction(name string) *CustomAction
- func (db *Db) NewNav() *Nav
- func (db *Db) NewObject(name string) *PersistentObject
- func (db *Db) NewQuery(name string) *Query
- type ExecutedQuery
- type Nav
- type NavItem
- type Notification
- type NotificationType
- type PersistentObject
- func (obj *PersistentObject) AddNotification(text string, notificationType NotificationType)
- func (obj *PersistentObject) ClearPasswords()
- func (obj *PersistentObject) Copy() *PersistentObject
- func (obj *PersistentObject) CopyFrom(data any)
- func (obj *PersistentObject) CopyTo() any
- func (obj *PersistentObject) GetAttribute(id string) *Attribute
- func (obj *PersistentObject) GetLabel() string
- func (obj *PersistentObject) GetLabelByLanguage(language string) string
- func (obj *PersistentObject) HasError() bool
- func (obj *PersistentObject) IsReadOnly() bool
- type Query
- type QueryColumn
- type QueryResult
- type QueryRow
- type QueryRowItem
- type Type
Constants ¶
View Source
const ( Bool = Type("bool") String = Type("string") Int = Type("int") Int8 = Type("int8") Int16 = Type("int16") Int32 = Type("int32") Int64 = Type("int64") UInt = Type("uint") UInt8 = Type("uint8") UInt16 = Type("uint16") UInt32 = Type("uint32") UInt64 = Type("uint64") Byte = Type("byte") Rune = Type("rune") Float32 = Type("float32") Float64 = Type("float64") Complex64 = Type("complex64") Complex128 = Type("complex128") Password = Type("password") Uuid = Type("uuid") Select = Type("select") Datalist = Type("data-list") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { Name string `json:"name"` Label map[string]string `json:"label"` ReadOnly bool `json:"readonly"` Required bool `json:"required"` Visibility AttributeVisibility `json:"visibility"` Rules []string `json:"rules"` Type Type `json:"type"` Options []string `json:"options"` ErrorText string `json:"-"` // contains filtered or unexported fields }
func (*Attribute) DisplayValue ¶
func (*Attribute) GetLabelByLanguage ¶
func (*Attribute) HasVisibility ¶
func (attr *Attribute) HasVisibility(visibility AttributeVisibility) bool
func (*Attribute) SetErrorText ¶
type AttributeVisibility ¶
type AttributeVisibility = uint
const ( VisibilityNew AttributeVisibility = 1 << iota VisibilityRead VisibilityEdit VisibilityQuery Always = VisibilityNew | VisibilityRead | VisibilityEdit | VisibilityQuery )
const (
VisibilityNever AttributeVisibility = 0
)
type CustomAction ¶
type CustomAction struct { Name string `json:"name"` Label map[string]string `json:"label"` Icon string `json:"icon"` Objects []string `json:"objects"` Queries []string `json:"queries"` }
func (*CustomAction) GetLabel ¶
func (action *CustomAction) GetLabel() string
func (*CustomAction) GetLabelByLanguage ¶
func (action *CustomAction) GetLabelByLanguage(language string) string
type Db ¶
type Db struct { Objects map[string]*PersistentObject `json:"objects"` Queries map[string]*Query `json:"queries"` CustomActions map[string]*CustomAction `json:"customActions"` }
func LoadModelDb ¶
func (*Db) BindObject ¶
func (*Db) GetCustomAction ¶
func (db *Db) GetCustomAction(name string) *CustomAction
func (*Db) GetObject ¶
func (db *Db) GetObject(name string) *PersistentObject
func (*Db) NewCustomAction ¶
func (db *Db) NewCustomAction(name string) *CustomAction
func (*Db) NewObject ¶
func (db *Db) NewObject(name string) *PersistentObject
type ExecutedQuery ¶
type ExecutedQuery struct { *Query Rows []*QueryRow Page int MaxPage int CustomActions []*CustomAction Notifications []Notification }
func (*ExecutedQuery) AddNotification ¶
func (query *ExecutedQuery) AddNotification(text string, notificationType NotificationType)
func (*ExecutedQuery) MinusPage ¶
func (query *ExecutedQuery) MinusPage() int
func (*ExecutedQuery) PlusPage ¶
func (query *ExecutedQuery) PlusPage() int
type Notification ¶
type Notification struct { Text string Type NotificationType }
type NotificationType ¶
type NotificationType int
const ( NotificationSuccess NotificationType = iota NotificationError NotificationWarning NotificationInfo )
type PersistentObject ¶
type PersistentObject struct { Name string `json:"name"` Label map[string]string `json:"label"` Attributes []*Attribute `json:"attributes"` Table string `json:"table"` Breadcrumb string `json:"breadcrumb"` ReadOnly bool `json:"readonly"` Id string IsNew bool CreateStruct func() any CustomActions []*CustomAction Notifications []Notification }
func (*PersistentObject) AddNotification ¶
func (obj *PersistentObject) AddNotification(text string, notificationType NotificationType)
func (*PersistentObject) ClearPasswords ¶
func (obj *PersistentObject) ClearPasswords()
func (*PersistentObject) Copy ¶
func (obj *PersistentObject) Copy() *PersistentObject
func (*PersistentObject) CopyFrom ¶
func (obj *PersistentObject) CopyFrom(data any)
func (*PersistentObject) CopyTo ¶
func (obj *PersistentObject) CopyTo() any
func (*PersistentObject) GetAttribute ¶
func (obj *PersistentObject) GetAttribute(id string) *Attribute
func (*PersistentObject) GetLabel ¶
func (obj *PersistentObject) GetLabel() string
func (*PersistentObject) GetLabelByLanguage ¶
func (obj *PersistentObject) GetLabelByLanguage(language string) string
func (*PersistentObject) HasError ¶
func (obj *PersistentObject) HasError() bool
func (*PersistentObject) IsReadOnly ¶
func (obj *PersistentObject) IsReadOnly() bool
type Query ¶
type Query struct { Name string `json:"name"` Label map[string]string `json:"label"` Object string `json:"object"` Columns []*QueryColumn `json:"columns"` Pagination int `json:"pagination"` }
func (*Query) GetLabelByLanguage ¶
type QueryColumn ¶
func (*QueryColumn) GetLabel ¶
func (column *QueryColumn) GetLabel() string
func (*QueryColumn) GetLabelByLanguage ¶
func (column *QueryColumn) GetLabelByLanguage(language string) string
type QueryResult ¶
type QueryResult struct {
Items []any
}
type QueryRow ¶
type QueryRow struct { Items []*QueryRowItem Id string }
func (*QueryRow) Item ¶
func (row *QueryRow) Item(id string) *QueryRowItem
type QueryRowItem ¶
func (*QueryRowItem) SetValue ¶
func (item *QueryRowItem) SetValue(value any)
Click to show internal directories.
Click to hide internal directories.