Documentation ¶
Index ¶
- Constants
- Variables
- func Parse(srcFileName string, rc *ds.RecordPackage) error
- func ParseFields(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseFieldsObject(dst *ds.RecordPackage, fieldsobject []*ast.Field) error
- func ParseFieldsTag(field *ast.Field, newfield *ds.FieldDeclaration, newindex *ds.IndexDeclaration) error
- func ParseFlags(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseImport(dst *ds.RecordPackage, importSpec *ast.ImportSpec) error
- func ParseIndexPart(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseIndexPartTag(field *ast.Field, ind *ds.IndexDeclaration, indexMap map[string]int, ...) error
- func ParseIndexTag(field *ast.Field, ind *ds.IndexDeclaration, fieldsMap map[string]int) error
- func ParseIndexes(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseSerializer(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseTrigger(dst *ds.RecordPackage, fields []*ast.Field) error
- func ParseTriggerTag(trigger *ds.TriggerDeclaration, field *ast.Field) error
- func ParseTypeSerializer(dst *ds.RecordPackage, serializerName string, t interface{}) (string, error)
- type ParamValueRule
- type StructNameType
- type TagNameType
- type TypeName
Constants ¶
View Source
const ( NoCheckFlag = 0 CheckFlagEmpty = 1 << iota )
View Source
const NameDefaultRule = "__DEFAULT__"
Variables ¶
View Source
var PublicNameChecker = regexp.MustCompile("^[A-Z]")
View Source
var ToLower = cases.Lower(language.English)
Functions ¶
func ParseFields ¶
func ParseFields(dst *ds.RecordPackage, fields []*ast.Field) error
Функция парсинга полей модели
func ParseFieldsObject ¶
func ParseFieldsObject(dst *ds.RecordPackage, fieldsobject []*ast.Field) error
Процесс парсинга декларативного описания связи между сущностями
func ParseFieldsTag ¶
func ParseFieldsTag(field *ast.Field, newfield *ds.FieldDeclaration, newindex *ds.IndexDeclaration) error
Функция парсинга тегов полей модели
func ParseFlags ¶
func ParseFlags(dst *ds.RecordPackage, fields []*ast.Field) error
Парсинг флагов. В описании модели можно указать, что целочисленное значение используется для хранения битовых флагов. В этом случае на поле навешиваются мутаторы SetFlag и ClearFlag
func ParseImport ¶
func ParseImport(dst *ds.RecordPackage, importSpec *ast.ImportSpec) error
func ParseIndexPart ¶
func ParseIndexPart(dst *ds.RecordPackage, fields []*ast.Field) error
func ParseIndexPartTag ¶
func ParseIndexPartTag(field *ast.Field, ind *ds.IndexDeclaration, indexMap map[string]int, fields []ds.FieldDeclaration, indexes []ds.IndexDeclaration) error
func ParseIndexTag ¶
func ParseIndexes ¶
func ParseIndexes(dst *ds.RecordPackage, fields []*ast.Field) error
func ParseSerializer ¶
func ParseSerializer(dst *ds.RecordPackage, fields []*ast.Field) error
func ParseTrigger ¶
func ParseTrigger(dst *ds.RecordPackage, fields []*ast.Field) error
Парсинг заявленных триггеров в описании модели
func ParseTriggerTag ¶
func ParseTriggerTag(trigger *ds.TriggerDeclaration, field *ast.Field) error
func ParseTypeSerializer ¶
func ParseTypeSerializer(dst *ds.RecordPackage, serializerName string, t interface{}) (string, error)
Types ¶
type ParamValueRule ¶
type ParamValueRule int
const ( ParamNeedValue ParamValueRule = iota ParamNotNeedValue )
type StructNameType ¶
type StructNameType string
const ( Fields StructNameType = "Fields" FieldsObject StructNameType = "FieldsObject" Indexes StructNameType = "Indexes" IndexParts StructNameType = "IndexParts" Serializers StructNameType = "Serializers" Triggers StructNameType = "Triggers" Flags StructNameType = "Flags" )
type TagNameType ¶
type TagNameType string
const ( SelectorTag TagNameType = "selector" PrimaryKeyTag TagNameType = "primary_key" UniqueTag TagNameType = "unique" MutatorsTag TagNameType = "mutators" SizeTag TagNameType = "size" SerializerTag TagNameType = "serializer" FieldsTag TagNameType = "fields" OrderdescTag TagNameType = "orderdesc" )
Click to show internal directories.
Click to hide internal directories.