Versions in this module Expand all Collapse all v0 v0.3.1 Sep 21, 2023 Changes in this version + const ENTITY_NOT_FOUND + const FIELD_NOT_FOUND + const FIELD_TYPE_ASSOCIATION + const FIELD_TYPE_CACHE_INVALID + const FIELD_TYPE_COMPOSITION + const FIELD_TYPE_INTERNAL_ERROR + const FIELD_TYPE_RWMUTEX + const FIELD_TYPE_VALIDATION_VALID + const FIELD_TYPE_XML_NAME + const STATUS_DEPRECATED + const STATUS_DISABLE + const STATUS_ENABLED + const TYPE_CACHE_KEY_PREFIX_ALL + const TYPE_CACHE_KEY_PREFIX_EMPTY_REF + const TYPE_CACHE_KEY_PREFIX_EMPTY_TAG + var FIELD_TYPE_ASSOCIATION_RT = reflect.TypeOf((*interface{})(nil)).Elem() + var FIELD_TYPE_COMPOSITION_RT = reflect.TypeOf((*interface{})(nil)).Elem() + var FIELD_TYPE_INTERNAL_ERROR_RT = reflect.TypeOf((*_err.Errors)(nil)).Elem() + var FIELD_TYPE_RWMUTEX_RT = reflect.TypeOf(sync.RWMutex{}) + var FIELD_TYPE_XML_NAME_RT = reflect.TypeOf(xml.Name{}) + func ArgNotEmpty(arg interface{}) bool + func ArgToString(arg interface{}) string + func ArgsAllEmpty(args []interface{}) bool + func ArgsMapToStrings(sep string, args map[string]interface{}) string + func ArgsSliceToString(sep string, args []interface{}) string + func ArgsSliceToStrings(args []interface{}) []string + func ArgsToString(sep string, args ...interface{}) string + func ArgsToStrings(args ...interface{}) []string + func JSONCamelCase(s string) string + func JSONSnakeCase(s string) string + type Alias struct + Description string + DisplayName string + ExternalName string + FullName string + type DbStorage struct + ColumnDefault string + ColumnMandatory bool + ColumnName string + ColumnType string + DirectSqlSelect string + DirectSqlWhere string + ObjectName string + SchemaName string + StorageName string + TableName string + type Definition struct + Buf []byte + Format string + Json *json.RawMessage + Name string + Source string + SourceFileName string + func (definition *Definition) LoadFromFile(sourceDir string) error + type Entities []*Entity + type Entity struct + Alias Alias + DbStorage DbStorage + Definition *Definition + Embed bool + Exprs Exprs + Fields Fields + InheritFromName string + KeysDef Keys + Modify Modify + Name string + ReferencesDef References + SkipCache bool + Status string + StorageName string + Tag Tag + Type interface{} + func (entity *Entity) AddPkFieldsToMap(fieldsMap *FieldsMap) + func (entity *Entity) AddSystemFieldsToMap(fieldsMap *FieldsMap) + func (entity *Entity) AssociationMap() FieldsMap + func (entity *Entity) CacheInvalidValuePtr(structPtrValue reflect.Value) (invalid bool, err error) + func (entity *Entity) CompositionMap() FieldsMap + func (entity *Entity) CopyMapToStruct(fromMapInterface interface{}, toRow *Object, outFields FieldsMap) (empty bool, err error) + func (entity *Entity) CopyObjectSlice(fromSlice *Object, toSlice *Object, outFields FieldsMap) (err error) + func (entity *Entity) CopyObjectStruct(fromStruct *Object, toStruct *Object, outFields FieldsMap) (err error) + func (entity *Entity) CopySlicePtrByFieldName(fromPtr interface{}, toPtr interface{}, outFields FieldsMap) (err error) + func (entity *Entity) CopyStructPtrByFieldName(fromPtr interface{}, toPtr interface{}, outFields FieldsMap) (err error) + func (entity *Entity) DefTypeCacheKey() string + func (entity *Entity) DefTypeCacheKeyEmptyRef() string + func (entity *Entity) DefTypeCacheKeyEmptyTag() string + func (entity *Entity) ExprsByAction(action ExprAction) *Exprs + func (entity *Entity) FieldByName(name string) *Field + func (entity *Entity) FieldByTagName(format, tag string) *Field + func (entity *Entity) FieldDisplayName(name string) string + func (entity *Entity) FieldFullName(name string) string + func (entity *Entity) FieldRV(field *Field, row *Object) (value reflect.Value, err error) + func (entity *Entity) FieldValue(field *Field, row *Object) (value interface{}, err error) + func (entity *Entity) FieldValuePtr(field *Field, structPtrValue reflect.Value) (value reflect.Value, err error) + func (entity *Entity) FieldsExprs() Exprs + func (entity *Entity) FieldsExprsByAction(action ExprAction) *Exprs + func (entity *Entity) FieldsMap() FieldsMap + func (entity *Entity) FieldsRV(fields Fields, row *Object) (values []reflect.Value, err error) + func (entity *Entity) FieldsValue(fields Fields, row *Object) (values []interface{}, err error) + func (entity *Entity) FieldsValuePtr(fields Fields, structPtrValue reflect.Value) (values []interface{}, err error) + func (entity *Entity) GetAssociation(name string) *Reference + func (entity *Entity) GetComposition(name string) *Reference + func (entity *Entity) GetErrors() *Field + func (entity *Entity) GetTag(format string, useNameAsDefault bool) string + func (entity *Entity) GetTagName(format string, useNameAsDefault bool) string + func (entity *Entity) GetXMLName() *Field + func (entity *Entity) GetXmlNameFromTag(useNameAsDefault bool) *xml.Name + func (entity *Entity) HasAssociations() bool + func (entity *Entity) HasCompositions() bool + func (entity *Entity) KeyByName(name string) *Key + func (entity *Entity) KeyFieldsRV(key *Key, row *Object) (values []reflect.Value, err error) + func (entity *Entity) KeyFieldsValue(key *Key, row *Object) (values []interface{}, err error) + func (entity *Entity) KeyFieldsValuePtr(key *Key, structPtrValue reflect.Value) (values []interface{}, err error) + func (entity *Entity) Keys() Keys + func (entity *Entity) NewSlice(fields FieldsMap, typeCacheKey string, len, cap int) (cacheHit bool, slice *Object, err error) + func (entity *Entity) NewStruct(fields FieldsMap, typeCacheKey string) (cacheHit bool, row *Object, err error) + func (entity *Entity) PKFieldsName() []string + func (entity *Entity) PKKey() *Key + func (entity *Entity) ReferenceByName(name string) *Reference + func (entity *Entity) ReferenceFieldsValue(reference *Reference, row *Object) (values []interface{}, err error) + func (entity *Entity) ReferenceFieldsValuePtr(reference *Reference, structPtrValue reflect.Value) (values []interface{}, err error) + func (entity *Entity) References() References + func (entity *Entity) SetCacheInvalidValuePtr(structPtrValue reflect.Value, invalid bool) (err error) + func (entity *Entity) SetErrorValue(row *Object, errors _err.Errors) (err error) + func (entity *Entity) SetErrorValuePtr(structPtrValue reflect.Value, errors _err.Errors) (err error) + func (entity *Entity) SetFieldRV(field *Field, row *Object, inRV reflect.Value) (err error) + func (entity *Entity) SetFieldValuePtr(field *Field, structPtrValue reflect.Value, val reflect.Value) (err error) + func (entity *Entity) SetTypeCache(key string, inRowType reflect.Type) (typeCacheEntry *TypeCacheEntry) + func (entity *Entity) SetXmlNameValue(row *Object, xmlName *xml.Name) (err error) + func (entity *Entity) SetXmlNameValueFromTag(row *Object) (err error) + func (entity *Entity) SetXmlNameValueFromTagSlice(slice *Object) (err error) + func (entity *Entity) SetXmlNameValuePtr(structPtrValue reflect.Value, xmlName *xml.Name) (err error) + func (entity *Entity) SetXmlNameValuePtrFromTag(structPtrValue reflect.Value) (err error) + func (entity *Entity) SetXmlNameValuePtrFromTagSlice(slicePtrValue reflect.Value) (err error) + func (entity *Entity) SetXmlNameValueSlice(slice *Object, xmlName *xml.Name) (err error) + func (entity *Entity) StructFields() Fields + func (entity *Entity) StructFieldsMap() FieldsMap + func (entity *Entity) StructOf(restrictFields FieldsMap, ...) (structType reflect.Type, err error) + func (entity *Entity) TypeCache(key string) (*TypeCacheEntry, bool) + func (entity *Entity) TypeCacheKey(prefix string, fields FieldsMap) string + func (entity *Entity) ValidationRules() map[string]string + func (entity *Entity) ValidationRulesType() (map[string]string, interface{}) + func (entity *Entity) ZeroFieldRV(field *Field, row *Object) (err error) + type EntityMap map[string]*Entity + func (ent EntityMap) Delete(entityName string) + func (ent EntityMap) GetDisplayName(entityName string) string + func (ent EntityMap) GetEntity(entityName string) *Entity + func (ent EntityMap) GetEntitySafe(entityName string) *Entity + func (ent EntityMap) GetFieldDisplayName(entityName string, fieldName string) string + func (ent EntityMap) GetFieldFullName(entityName string, fieldName string) string + func (ent EntityMap) GetFullName(entityName string) string + func (ent EntityMap) Set(entityName string, entity *Entity) + type Expr struct + Action ExprAction + Code string + FieldsArgsName []string + FieldsDestName []string + Name string + Status string + Type ExprType + func NewExpr(entity *Entity, field *Field, status string, name string, type_ ExprType, ...) (ex *Expr, err error) + func (ex *Expr) ArgsFields() Fields + func (ex *Expr) CalculateField(externalId uint64, row *Object, exprVm *vm.VM) (output interface{}, err error) + func (ex *Expr) CheckAction(action ExprAction) bool + func (ex *Expr) Convert(externalId uint64, rowIn *Object, rowOut *Object, exprVm *vm.VM) (output interface{}, err error) + func (ex *Expr) CopyField(externalId uint64, rowIn *Object, rowOut *Object, exprVm *vm.VM) (output interface{}, err error) + func (ex *Expr) DestFields() Fields + func (ex *Expr) Entity() *Entity + func (ex *Expr) Field() *Field + func (ex *Expr) FilterSlice(externalId uint64, rows *Object, exprVm *vm.VM) (output interface{}, err error) + func (ex *Expr) FilterSliceFromStructField(externalId uint64, row *Object, exprVm *vm.VM) (output interface{}, err error) + func (ex *Expr) IsInit() bool + func (ex *Expr) Run(externalId uint64, env interface{}, exprVm *vm.VM) (output interface{}, err error) + type ExprAction string + const EXPR_ACTION_ALL + const EXPR_ACTION_GET + const EXPR_ACTION_INSIDE_GET + const EXPR_ACTION_INSIDE_PUT + const EXPR_ACTION_MARSHAL + const EXPR_ACTION_NULL + const EXPR_ACTION_POST_FETCH + const EXPR_ACTION_POST_GET + const EXPR_ACTION_POST_MARSHAL + const EXPR_ACTION_POST_PUT + const EXPR_ACTION_PRE_MARSHAL + const EXPR_ACTION_PRE_PUT + const EXPR_ACTION_PUT + type ExprType string + const EXPR_CALCULATE + const EXPR_CONVERT + const EXPR_COPY + const EXPR_DB_CALCULATE + const EXPR_FILTER + const EXPR_VALIDATE + type Exprs []*Expr + type ExprsByAction map[ExprAction]*Exprs + type Field struct + Alias Alias + CopyFromName string + DbStorage DbStorage + Exprs Exprs + Format string + InheritFromName string + InternalType string + Modify Modify + Name string + Order int + Required bool + Status string + System bool + Tag Tag + ValidateRule string + func (field *Field) CheckFieldReference() error + func (field *Field) Entity() *Entity + func (field *Field) GetTag(format string, useNameAsDefault bool) string + func (field *Field) GetTagName(format string, useNameAsDefault bool) string + func (field *Field) GetXmlNameFromTag(useNameAsDefault bool) *xml.Name + func (field *Field) Index(t reflect.Type) []int + func (field *Field) Reference() *Reference + func (field *Field) References() References + func (field *Field) ReflectType() reflect.Type + type FieldNumber int32 + type Fields []*Field + func (fields Fields) Get(fieldName string) *Field + func (fields Fields) GetDisplayName(fieldName string) string + func (fields Fields) GetFullName(fieldName string) string + func (fields Fields) GetValidationRules() map[string]string + type FieldsMap map[string]*Field + func (fieldsMap FieldsMap) Copy() FieldsMap + func (fieldsMap FieldsMap) Get(name string) *Field + func (fieldsMap FieldsMap) GetDisplayName(fieldName string) string + func (fieldsMap FieldsMap) GetFullName(fieldName string) string + func (fieldsMap FieldsMap) GetValidationRules() map[string]string + func (fieldsMap FieldsMap) Merge(fieldsMap2 FieldsMap) FieldsMap + func (fieldsMap FieldsMap) String() string + type FieldsV2 struct + List Fields + Map FieldsMap + func (p *FieldsV2) Get(i int) *Field + func (p *FieldsV2) Len() int + type GlobalOptions struct + EmbedError bool + IgnoreExtraField bool + KeepLock bool + MultiRow bool + NameFormat string + OutFormat string + OutTrace bool + Persist bool + SkipCache bool + SkipCalculation bool + StaticFiltering bool + TxExternal uint64 + UseCache bool + Validate bool + type Key struct + Alias Alias + CopyFromName string + DbStorage DbStorage + FieldsName []string + InheritFromName string + Modify Modify + Name string + Status string + Type KeyType + func (key *Key) AddFieldsToMap(fieldsMap *FieldsMap) + func (key *Key) Entity() *Entity + func (key *Key) Fields() Fields + func (key *Key) FieldsMap() FieldsMap + func (key *Key) FieldsString() string + type KeyType string + const KEY_TYPE_FK + const KEY_TYPE_PK + const KEY_TYPE_UK + type Keys []*Key + type KeysMap map[string]*Key + func (keysMap KeysMap) Get(name string) *Key + type Meta struct + Entities Entities + Name string + Status string + func NewMeta() *Meta + func (meta *Meta) Backup() *Meta + func (meta *Meta) GetDisplayName(entityName string) string + func (meta *Meta) GetEntity(entityName string) *Entity + func (meta *Meta) GetEntitySafe(entityName string) *Entity + func (meta *Meta) GetEntityUnsafe(entityName string) *Entity + func (meta *Meta) GetFieldDisplayName(entityName string, fieldName string) string + func (meta *Meta) GetFieldFullName(entityName string, fieldName string) string + func (meta *Meta) GetFullName(entityName string) string + func (meta *Meta) Init() error + func (meta *Meta) InitUnsafe() error + func (meta *Meta) Lock() + func (meta *Meta) RLock() + func (meta *Meta) RUnlock() + func (meta *Meta) Restore(copyMeta *Meta) + func (meta *Meta) Set(entity *Entity, doReplace bool, doInit bool) error + func (meta *Meta) SetEntityFromDefinitionUnsafe(definition *Definition, doReplace bool, doInit bool) (*Entity, error) + func (meta *Meta) Unlock() + type Modify struct + CopyRestrict bool + CreateRestrict bool + DeleteRestrict bool + RetrieveRestrict bool + UpdateRestrict bool + VisibleRestrict bool + type Name string + type Object struct + AssociationMap ObjectReferenceMap + CompositionMap ObjectReferenceMap + Entity *Entity + Fields FieldsMap + IsSlice bool + Objects Objects + Options *Options + OrgObject *Object + RV reflect.Value + Reference *Reference + StructPtrType reflect.Type + StructType reflect.Type + Value interface{} + func (o *Object) AppendObject(obj *Object) + func (o *Object) CacheInvalid() bool + func (o *Object) ClearObjects() + func (o *Object) Copy(copyAssociation bool, copyComposition bool) *Object + func (o *Object) CopyAssociationFrom(from *Object) + func (o *Object) CopyCompositionFrom(from *Object) + func (o *Object) FieldRV(field *Field) (value reflect.Value, err error) + func (o *Object) FieldValue(field *Field) (value interface{}, err error) + func (o *Object) FieldsRV(fields Fields) (values []reflect.Value, err error) + func (o *Object) FieldsValue(fields Fields) (values []interface{}, err error) + func (o *Object) KeyFieldsRV(key *Key) (values []reflect.Value, err error) + func (o *Object) KeyFieldsValue(key *Key) (values []interface{}, err error) + func (o *Object) KeyValue(key *Key) []interface{} + func (o *Object) KeyValueString(key *Key) string + func (o *Object) KeysValueString() string + func (o *Object) Lock() + func (o *Object) NewFromRV(rv reflect.Value, isSlice bool) *Object + func (o *Object) PKKey() *Key + func (o *Object) PKValue() []interface{} + func (o *Object) RLock() + func (o *Object) RUnlock() + func (o *Object) ReferenceFieldsValue(reference *Reference) (values []interface{}, err error) + func (o *Object) SetAssociationUnsafe(field *Field, obj *Object) error + func (o *Object) SetCacheInvalid(cacheInvalid bool) + func (o *Object) SetCacheInvalidUnsafe(cacheInvalid bool) + func (o *Object) SetCompositionUnsafe(field *Field, obj *Object) error + func (o *Object) SetErrorValue(errors _err.Errors) (err error) + func (o *Object) SetFieldRV(field *Field, val reflect.Value) (err error) + func (o *Object) SetFromRV(rv reflect.Value) + func (o *Object) SetKeyFieldsRV(key *Key, values []reflect.Value) (err error) + func (o *Object) SetXmlNameValue(xmlName *xml.Name) (err error) + func (o *Object) SetXmlNameValueFromTag() (err error) + func (o *Object) SetXmlNameValueFromTagSlice() (err error) + func (o *Object) SetXmlNameValueSlice(xmlName *xml.Name) (err error) + func (o *Object) Unlock() + func (o *Object) ZeroFieldRV(field *Field) (err error) + type ObjectReferenceMap map[*Reference]*Object + type Objects []*Object + type Options struct + CascadeDown int + CascadeUp int + DbFieldsWhere map[string]string + DbLimit string + DbOffset string + DbOrder string + DbWhere string + Entity *Entity + Fields FieldsMap + FilterPostExpr *Expr + FilterPostRefExprs map[*Reference]*Expr + FilterPreExpr *Expr + FromEntity *Entity + Global *GlobalOptions + Key string + QueryOptions QueryOptions + QueryOptionsDown QueryOptions + type QueryOptions map[string]string + func (opt *QueryOptions) Copy() (out QueryOptions) + type Reference struct + Alias Alias + Cardinality ReferenceCardinality + CopyFromName string + DbStorage DbStorage + Embed bool + Exprs Exprs + FieldsName []string + InheritFromName string + Name string + Required bool + Status string + Tag Tag + ToEntityName string + ToKeyName string + ToReferenceName string + Type ReferenceType + ValidateRule string + func (ref *Reference) AddFieldsToMap(fieldsMap *FieldsMap) + func (ref *Reference) Entity() *Entity + func (ref *Reference) Field() *Field + func (ref *Reference) FieldsMap() FieldsMap + func (ref *Reference) FieldsString() string + func (ref *Reference) GetTag(format string, useNameAsDefault bool) string + func (ref *Reference) GetTagName(format string, useNameAsDefault bool) string + func (ref *Reference) ToEntity() *Entity + func (ref *Reference) ToKey() *Key + func (ref *Reference) ToReference() *Reference + type ReferenceCardinality string + const REFERENCE_CARDINALITY_0 + const REFERENCE_CARDINALITY_1 + const REFERENCE_CARDINALITY_EMPTY + const REFERENCE_CARDINALITY_M + type ReferenceType string + const REFERENCE_TYPE_ASSOCIATION + const REFERENCE_TYPE_COMPOSITION + type References []*Reference + type ReferencesMap map[string]*Reference + func (referencesMap ReferencesMap) Get(name string) *Reference + type Tag struct + Db string + DbName string + Expr string + ExprName string + Json string + JsonName string + Sql string + Xls string + XlsName string + XlsSheet string + Xml string + XmlName string + XmlSpace string + Yaml string + YamlName string + func (tag *Tag) GetName(format string) string + func (tag *Tag) GetTag(format string) string + type TypeCache struct + func NewTypeCache() *TypeCache + func (typeCache *TypeCache) Get(key string) (*TypeCacheEntry, bool) + func (typeCache *TypeCache) Set(key string, inRowType reflect.Type) (typeCacheEntry *TypeCacheEntry) + type TypeCacheEntry struct