Documentation
¶
Overview ¶
Generated by gitee.com/jackytse/tabtoy Version: 2.7.4 DO NOT EDIT!!
Index ¶
- Constants
- Variables
- func FieldTypeToString(t FieldType) string
- func IsSystemTag(tag string) bool
- func MakeTag(t int32, order int32) int32
- type Builtin
- type BuiltinTable
- type ConditionType
- type DataModel
- type Descriptor
- type DescriptorKind
- type DescriptorUsage
- type FieldDescriptor
- func (self *FieldDescriptor) DefaultValue() string
- func (self *FieldDescriptor) Equal(fd *FieldDescriptor) bool
- func (self *FieldDescriptor) KindString() string
- func (self *FieldDescriptor) ListSpliter() string
- func (self *FieldDescriptor) ParseType(fileD *FileDescriptor, rawstr string) bool
- func (self *FieldDescriptor) RepeatCheck() bool
- func (self *FieldDescriptor) String() string
- func (self *FieldDescriptor) Tag() int32
- func (self *FieldDescriptor) TypeString() string
- type FieldType
- type FieldValue
- type FileDescriptor
- type GlobalChecker
- type LineData
- type MetaInfo
- type Node
- type Record
- type Table
- type TableTypes
- type TableVerify
- type ValueRange
Constants ¶
View Source
const RepeatedKeyword = "repeated"
View Source
const RepeatedKeywordLen = len(RepeatedKeyword)
View Source
const SliceKeyword = "[]"
View Source
const SliceKeywordLen = len(SliceKeyword)
View Source
const TypeSheetName = "@Types"
Variables ¶
View Source
var ( ErrDuplicateFieldName = errors.New("Duplicate field name") ErrDuplicateIndexName = errors.New("Duplicate index name") )
Functions ¶
func FieldTypeToString ¶
func IsSystemTag ¶
Types ¶
type BuiltinTable ¶
type BuiltinTable struct {
// 表格原始数据
Builtin
// contains filtered or unexported fields
}
Builtin 访问接口
func (*BuiltinTable) RegisterIndexEntry ¶
func (self *BuiltinTable) RegisterIndexEntry(name string, indexCallback func(*BuiltinTable), clearCallback func(*BuiltinTable))
注册外部索引入口, 索引回调, 清空回调
type ConditionType ¶
type ConditionType int32
Defined in table: Types
const ( // 无 ConditionType_None ConditionType = 0 // 值存在 ConditionType_ValueExists ConditionType = 1 // 值相等 ConditionType_ValueEqual ConditionType = 2 // 值范围 ConditionType_ValueRange ConditionType = 3 )
type DataModel ¶
type DataModel struct {
Lines []*LineData
}
对应table
func NewDataModel ¶
func NewDataModel() *DataModel
type Descriptor ¶
type Descriptor struct {
Name string
Kind DescriptorKind
Usage DescriptorUsage
FieldByName map[string]*FieldDescriptor
FieldByNumber map[int32]*FieldDescriptor
Fields []*FieldDescriptor
Indexes []*FieldDescriptor
IndexByName map[string]*FieldDescriptor
File *FileDescriptor
}
func NewDescriptor ¶
func NewDescriptor() *Descriptor
func (*Descriptor) Add ¶
func (self *Descriptor) Add(def *FieldDescriptor) error
func (*Descriptor) FieldByValueAndMeta ¶
func (self *Descriptor) FieldByValueAndMeta(value string) *FieldDescriptor
type DescriptorKind ¶
type DescriptorKind int
const ( DescriptorKind_None DescriptorKind = iota DescriptorKind_Enum DescriptorKind_Struct )
type DescriptorUsage ¶
type DescriptorUsage int
const ( DescriptorUsage_None DescriptorUsage = iota DescriptorUsage_RowType // 每个表的行类型 DescriptorUsage_CombineStruct // 最终使用的合并结构体 )
type FieldDescriptor ¶
type FieldDescriptor struct {
Name string
Type FieldType
Complex *Descriptor // 复杂类型: 枚举或者结构体
Order int32 // 在Descriptor中的顺序
Meta *MetaInfo // 扩展字段
IsRepeated bool
EnumValue int32 // 枚举值
Comment string // 注释
Parent *Descriptor
}
一列的描述
func NewFieldDescriptor ¶
func NewFieldDescriptor() *FieldDescriptor
func (*FieldDescriptor) DefaultValue ¶
func (self *FieldDescriptor) DefaultValue() string
func (*FieldDescriptor) Equal ¶
func (self *FieldDescriptor) Equal(fd *FieldDescriptor) bool
func (*FieldDescriptor) KindString ¶
func (self *FieldDescriptor) KindString() string
func (*FieldDescriptor) ListSpliter ¶
func (self *FieldDescriptor) ListSpliter() string
func (*FieldDescriptor) ParseType ¶
func (self *FieldDescriptor) ParseType(fileD *FileDescriptor, rawstr string) bool
func (*FieldDescriptor) RepeatCheck ¶
func (self *FieldDescriptor) RepeatCheck() bool
func (*FieldDescriptor) String ¶
func (self *FieldDescriptor) String() string
func (*FieldDescriptor) Tag ¶
func (self *FieldDescriptor) Tag() int32
func (*FieldDescriptor) TypeString ¶
func (self *FieldDescriptor) TypeString() string
自动适配结构体和枚举输出合适的类型, 类型名为go only
type FieldType ¶
type FieldType int
const ( FieldType_None FieldType = 0 FieldType_Int32 FieldType = 1 FieldType_Int64 FieldType = 2 FieldType_UInt32 FieldType = 3 FieldType_UInt64 FieldType = 4 FieldType_Float FieldType = 5 FieldType_String FieldType = 6 FieldType_Bool FieldType = 7 FieldType_Enum FieldType = 8 FieldType_Struct FieldType = 9 FieldType_Table FieldType = 10 // 表格, 仅限二进制使用 )
func ParseFieldType ¶
type FieldValue ¶
type FileDescriptor ¶
type FileDescriptor struct {
Name string
DescriptorByName map[string]*Descriptor
Descriptors []*Descriptor
Pragma *MetaInfo
}
func NewFileDescriptor ¶
func NewFileDescriptor() *FileDescriptor
func (*FileDescriptor) Add ¶
func (self *FileDescriptor) Add(def *Descriptor) bool
func (*FileDescriptor) MatchTag ¶
func (self *FileDescriptor) MatchTag(tag string) bool
func (*FileDescriptor) RowDescriptor ¶
func (self *FileDescriptor) RowDescriptor() *Descriptor
取行类型的结构
type GlobalChecker ¶
type GlobalChecker interface {
CheckValueRepeat(fd *FieldDescriptor, value string) bool
GlobalFileDesc() *FileDescriptor
}
type LineData ¶
type LineData struct {
Values []*FieldValue
}
对应record
func NewLineData ¶
func NewLineData() *LineData
func (*LineData) Add ¶
func (self *LineData) Add(fv *FieldValue)
type Node ¶
type Node struct {
*FieldDescriptor
StructRoot bool // 结构体标记的dummy node
// 各种类型的值
Value string
EnumValue int32
Raw []byte
Child []*Node // 优先遍历值, 再key
SugguestIgnore bool // 建议忽略, 非repeated的普通字段导出时, 如果原单元格没填, 这个字段为true
}
func (*Node) AddKey ¶
func (self *Node) AddKey(def *FieldDescriptor) *Node
type Record ¶
type Record struct {
Nodes []*Node
// contains filtered or unexported fields
}
func (*Record) NewNodeByDefine ¶
func (self *Record) NewNodeByDefine(def *FieldDescriptor) *Node
type Table ¶
type Table struct {
LocalFD *FileDescriptor
GlobalFD *FileDescriptor
Recs []*Record
}
type TableTypes ¶
type TableTypes struct {
//对象类型
ObjectType string `MustFill:"true"`
//字段名
FieldName string `MustFill:"true"`
//字段类型
FieldType string `MustFill:"true"`
//枚举值
Value string
//别名
Alias string
//默认值
Default string
//特性
Meta string
//注释
Comment string
}
Defined in table: Types
type TableVerify ¶
type TableVerify struct {
//规则名
RuleName string `MustFill:"true"`
//条件
Condition string `MustFill:"true"`
//字段路径(类型名.字段名)
FieldPath string `MustFill:"true"`
//值
Value string `MustFill:"true"`
}
Defined in table: Types
type ValueRange ¶
Defined in table: Types
Click to show internal directories.
Click to hide internal directories.