generator

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	ColumnName string

	IsPK bool

	OmitEmpty bool

	FieldName string

	FieldType string
}

type Generator

type Generator struct {
	OutPkgName string

	SrcDir string

	SrcFileFilter func(os.FileInfo) bool
	// contains filtered or unexported fields
}

func (*Generator) Generate

func (g *Generator) Generate(w io.Writer) error

func (*Generator) ParseDir

func (g *Generator) ParseDir() error

type Import

type Import struct {
	Name string

	Path string
}

type Package

type Package struct {
	PackageName string

	Imports []*Import

	Tables []*Table
}

type Relation

type Relation struct {
	// another table name
	TableName string

	// this entity's field name
	FieldName string

	// another table entity type
	FieldType string

	// another table column names
	ColumnNames []string

	// this table columns
	ForeignKeys []*RelationalColumn

	// another table columns
	References []*RelationalColumn
}

Relation represents another table relation information.

type RelationalColumn

type RelationalColumn struct {
	ColumnName string

	FieldName string

	FieldType string
}

type Table

type Table struct {
	TableName string

	ReadOnly bool

	Entity string

	Columns []*Column

	OneToManyRelations []*Relation

	ManyToOneRelations []*Relation

	OneToOneRelations []*Relation
}

Jump to

Keyboard shortcuts

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