Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenBindFunc ¶
func GenBindFunc(conf *GenFuncConf) (string, error)
func GenFile ¶
func GenFile(config *GenFileConf) (string, error)
func PackageImport ¶
Types ¶
type GenFileConf ¶
type GenFileConf struct { Entities []GenFileEntityConf ExtraImports [][2]string }
type GenFileEntityConf ¶
type GenFileEntityConf struct { Actions []any ConfigBuilder func(act any) *GenFuncConf }
type GenFuncConf ¶
type GenFuncConf struct { IgnoreFields []string // fields to ignore, e.g. example.FieldID, example.FieldCreatedAt SourcePkgName string // package name of source, e.g. "ent" TargetPkgName string // package name of target, e.g. "entpb" // contains filtered or unexported fields }
func NewGenFuncConf ¶
func NewGenFuncConf(source, target, action any) *GenFuncConf
func (*GenFuncConf) WithIgnoreFields ¶
func (c *GenFuncConf) WithIgnoreFields(fields ...string) *GenFuncConf
func (*GenFuncConf) WithSourcePkgName ¶
func (c *GenFuncConf) WithSourcePkgName(pkgName string) *GenFuncConf
func (*GenFuncConf) WithTargetPkgName ¶
func (c *GenFuncConf) WithTargetPkgName(pkgName string) *GenFuncConf
type Option ¶
type Option func(*Options)
func ClearOnNilField ¶
func IgnoreField ¶
func IgnoreSetZeroField ¶
func KeepFieldsOnly ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewBindOptions ¶
func (*Options) CanSetField ¶
func (*Options) CanSetZero ¶
func (*Options) ClearOnNil ¶
func (*Options) IgnoreSetZero ¶
Click to show internal directories.
Click to hide internal directories.