parser

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name    string // value_name
	Type    string // value_type
	Tag     string // value_tag
	Comment string // 注释
}

nolint

type Schema

type Schema struct {
	TableName     string            // 表名
	Fields        []*Field          // 约束条件
	ModelType     string            // 表明是什么model类型
	FieldMap      map[string]*Field // 记录字段名和Field的映射关系
	StructComment string            // struct的注释
}

Schema代表数据库中的表

func ParseStruct

func ParseStruct(curPath string) (*Schema, error)

nolint

func (*Schema) GetField

func (schema *Schema) GetField(name string) *Field

Jump to

Keyboard shortcuts

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