schema

package
v0.0.0-...-c39eebc Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataType

type DataType string

type Field

type Field struct {
	StructName  string
	Name        string
	FieldType   reflect.Type
	StructField reflect.StructField
	Tag         *Tag
	Table       *Table
}

type Table

type Table struct {
	Model            interface{}
	TableName        TableName // 表名
	Fields           []*Field  // 字段
	FieldNames       []string  // 字段名(列名)
	StructFieldNames []string
	// contains filtered or unexported fields
}

func Parse

func Parse[T any](model T) *Table

func (*Table) GetField

func (s *Table) GetField(name string) *Field

func (*Table) RecordValues

func (s *Table) RecordValues(dest interface{}) []interface{}

type TableName

type TableName = string

type Tag

type Tag struct {
	Tag         reflect.StructTag
	TagSettings map[string]string
}

func ParseTag

func ParseTag(structTag reflect.StructTag, delimiter string) *Tag

func (*Tag) String

func (t *Tag) String() string

Jump to

Keyboard shortcuts

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