raw

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddField

func AddField(config *Config, name, desc, typ, param string, index int, isKey bool, pos int) error

AddField 添加字段到配置中

func IsBasicType

func IsBasicType(t FieldType) bool

IsBasicType 判断是否为基础类型

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(name, desc string) Config

NewConfig 创建一个配置

func (*Config) GetDescription

func (c *Config) GetDescription() string

GetDescription 获取配置描述

func (*Config) GetField

func (c *Config) GetField(name string) Field

GetField 获取指定字段描述

func (*Config) GetFieldNum

func (c *Config) GetFieldNum() int

GetFieldNum 获取原始字段数量

func (*Config) GetFieldStructure

func (c *Config) GetFieldStructure(name string) []Structure

GetFieldStructure 获取指定字段的结构体

func (*Config) GetFieldStructures

func (c *Config) GetFieldStructures() map[string][]Structure

GetFieldStructures 获取原始字段描述中包含的结构体

func (*Config) GetFields

func (c *Config) GetFields() map[string]Field

GetFields 获取原始字段描述

func (*Config) GetFieldsWithSort

func (c *Config) GetFieldsWithSort() []Field

GetFieldsWithSort 获取原始字段描述并按照索引排序

func (*Config) GetName

func (c *Config) GetName() string

GetName 获取配置名称

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field 原始字段描述

func (Field) GetDescription

func (f Field) GetDescription() string

GetDescription 获取字段描述

func (Field) GetIndex

func (f Field) GetIndex() int

GetIndex 获取字段索引顺序

func (Field) GetName

func (f Field) GetName() string

GetName 获取字段名称

func (Field) GetParam

func (f Field) GetParam() string

GetParam 获取字段参数

func (Field) GetPosition

func (f Field) GetPosition() int

GetPosition 获取字段在表中的位置

func (Field) GetType

func (f Field) GetType() string

GetType 获取字段类型

func (Field) IsKey

func (f Field) IsKey() bool

IsKey 是否是索引字段

type FieldType

type FieldType = string
const (
	FieldTypeInt     FieldType = "int"
	FieldTypeInt8    FieldType = "int8"
	FieldTypeInt16   FieldType = "int16"
	FieldTypeInt32   FieldType = "int32"
	FieldTypeInt64   FieldType = "int64"
	FieldTypeUint    FieldType = "uint"
	FieldTypeUint8   FieldType = "uint8"
	FieldTypeUint16  FieldType = "uint16"
	FieldTypeUint32  FieldType = "uint32"
	FieldTypeUint64  FieldType = "uint64"
	FieldTypeFloat32 FieldType = "float32"
	FieldTypeFloat64 FieldType = "float64"
	FieldTypeString  FieldType = "string"
	FieldTypeBool    FieldType = "bool"
)

type Structure

type Structure struct {
	// contains filtered or unexported fields
}

Structure 结构体描述

func (Structure) GetFields

func (s Structure) GetFields() []StructureField

GetFields 获取结构体字段描述

func (Structure) GetName

func (s Structure) GetName() string

GetName 获取结构体名称

type StructureField

type StructureField struct {
	// contains filtered or unexported fields
}

StructureField 结构体字段描述

func (StructureField) GetName

func (sf StructureField) GetName() string

GetName 获取字段名称

func (StructureField) GetType

func (sf StructureField) GetType() string

GetType 获取字段类型

type Table

type Table struct {
	// contains filtered or unexported fields
}

func NewTable

func NewTable(configs ...Config) Table

NewTable 创建一个表

func (*Table) GetConfig

func (t *Table) GetConfig(name string) Config

GetConfig 获取配置

func (*Table) GetConfigs

func (t *Table) GetConfigs() map[string]Config

GetConfigs 获取所有配置

Jump to

Keyboard shortcuts

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