model

package
v0.0.0-...-53aaad7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseField

type BaseField struct {
	FieldName string
	FieldType string
}

type BizPackage

type BizPackage struct {
	BasePackage    string
	PackageName    string
	ImportPackages []string
	BizTypes       []*BizType
}

func (*BizPackage) AppendImport

func (pkg *BizPackage) AppendImport(pkgName string) bool

func (*BizPackage) HasImports

func (pkg *BizPackage) HasImports() bool

type BizType

type BizType struct {
	PackageName string
	TypeName    string
	Fields      []*BaseField
	Model       *ModelType
	ViewModel   *ViewModelType
	Dao         *DaoType
	IsReadOnly  bool
}

type Column

type Column struct {
	TableName              string
	ColumnName             string
	IsPrimaryKey           bool
	IsNullable             bool
	IsAutoIncrement        bool
	IsUnique               bool
	DataType               string
	CharacterMaximumLength sql.NullInt64
	NumericPrecision       sql.NullInt64
	NumericScale           sql.NullInt64
	ColumnType             string
}

func (Column) GetPostgresParam

func (c Column) GetPostgresParam(i int) string

func (Column) GetPostgresParamFrom

func (c Column) GetPostgresParamFrom(i int, s int) string

type Configuration

type Configuration struct {
	Hostname                string
	Port                    string
	DatabaseType            string
	DatabaseName            string
	Username                string
	Password                string
	BasePackage             string
	OutputPath              string
	ExcludedEntities        []string
	Entities                []string
	SkipDaoGeneration       bool
	SkipBizGeneration       bool
	SkipServiceGeneration   bool
	ForcePluralResourceName bool
	PostgresSchema          string
}

func LoadConfiguration

func LoadConfiguration(path string) Configuration

func (*Configuration) IsExcluded

func (conf *Configuration) IsExcluded(name string) bool

func (*Configuration) IsIncluded

func (conf *Configuration) IsIncluded(name string) bool

type DaoPackage

type DaoPackage struct {
	BasePackage    string
	PackageName    string
	ImportPackages []string
	DaoTypes       []*DaoType
	ViewDaoTypes   []*DaoType
}

func (*DaoPackage) AppendImport

func (pkg *DaoPackage) AppendImport(pkgName string) bool

func (*DaoPackage) HasImports

func (pkg *DaoPackage) HasImports() bool

type DaoType

type DaoType struct {
	PackageName        string
	TypeName           string
	Fields             []*BaseField
	Model              *ModelType
	Entity             *Table
	View               *View
	HasAutoIncrementPK bool
}

type DatabaseSchema

type DatabaseSchema struct {
	SchemaName string
	Tables     []*Table
	Views      []*View
}

type ModelField

type ModelField struct {
	FieldName         string
	FieldType         string
	FieldMetadata     string
	IsPK              bool
	IsAutoInc         bool
	IsNullable        bool
	NullableFieldType string
}

func (ModelField) GetPostgresParam

func (mf ModelField) GetPostgresParam(i int) string

func (ModelField) GetPostgresParamFrom

func (mf ModelField) GetPostgresParamFrom(i int, s int) string

type ModelPackage

type ModelPackage struct {
	BasePackage    string
	PackageName    string
	ImportPackages []string
	ModelTypes     []*ModelType
	ViewModelTypes []*ModelType
}

func (*ModelPackage) AppendImport

func (pkg *ModelPackage) AppendImport(pkgName string) bool

func (*ModelPackage) HasImport

func (pkg *ModelPackage) HasImport(impPkg string) bool

func (*ModelPackage) HasImports

func (pkg *ModelPackage) HasImports() bool

type ModelType

type ModelType struct {
	PackageName string
	TypeName    string
	Fields      []*ModelField
	PKFields    []*ModelField
	OtherFields []*ModelField
}

type ServicePackage

type ServicePackage struct {
	BasePackage    string
	PackageName    string
	ImportPackages []string
	ServiceTypes   []*ServiceType
}

func (*ServicePackage) AppendImport

func (pkg *ServicePackage) AppendImport(pkgName string) bool

func (*ServicePackage) HasImports

func (pkg *ServicePackage) HasImports() bool

type ServiceType

type ServiceType struct {
	PackageName  string
	TypeName     string
	ResourceName string
	Fields       []*BaseField
	ViewModel    *ViewModelType
	Biz          *BizType
	IsSimplePK   bool
}

type Table

type Table struct {
	TableName    string
	Columns      []*Column
	PrimaryKeys  []*Column
	OtherColumns []*Column
}

type View

type View struct {
	ViewName string
	Columns  []*Column
}

type ViewModelField

type ViewModelField struct {
	FieldName  string
	FieldType  string
	IsNullable bool
}

type ViewModelPackage

type ViewModelPackage struct {
	BasePackage    string
	PackageName    string
	ImportPackages []string
	ViewModelTypes []*ViewModelType
}

func (*ViewModelPackage) AppendImport

func (pkg *ViewModelPackage) AppendImport(pkgName string) bool

func (*ViewModelPackage) HasImports

func (pkg *ViewModelPackage) HasImports() bool

type ViewModelType

type ViewModelType struct {
	PackageName  string
	TypeName     string
	Fields       []*ViewModelField
	PKFields     []*ViewModelField
	IsSimplePK   bool
	PKType       string
	PKStringConv string
}

Jump to

Keyboard shortcuts

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