modelgen

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRelation

func AddRelation(modelFile string, relations []RelationInfo, modelName string) error

AddRelation menambahkan relasi ke file model

func GenerateModelEntity

func GenerateModelEntity(modelName string, fields []FieldInfo, baseFolder string) error

GenerateModelEntity membuat GORM-ready model, entity, dan file migrasi

Types

type FieldInfo

type FieldInfo struct {
	Name string
	Type string
}

type RelationInfo

type RelationInfo struct {
	FieldName string
	Target    string
	Type      RelationType
}

type RelationType

type RelationType string
const (
	One2Many  RelationType = "one2many"
	Many2Many RelationType = "many2many"
)

Jump to

Keyboard shortcuts

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