generator

package module
v0.0.0-...-0f7df96 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTableStruct

func GenerateTableStruct(db *gorm.DB, options ...Option)

Types

type FileNameHandler

type FileNameHandler func(tableName string) (fileName string)

type ModelNameHandler

type ModelNameHandler func(tableName string) (modelName string)

type Option

type Option func(config *option)

func GenTables

func GenTables(table ...string) Option

default: all

func WithFieldCoverable

func WithFieldCoverable(yes bool) Option

generate pointer when field has default value

func WithFieldNullable

func WithFieldNullable(yes bool) Option

func WithGenerateMode

func WithGenerateMode(mode gen.GenerateMode) Option

func WithOutFileNameHandler

func WithOutFileNameHandler(handler FileNameHandler) Option

func WithOutFileSuffixName

func WithOutFileSuffixName(path string) Option

default: xxx.gen.go

func WithOutModelNameHandler

func WithOutModelNameHandler(handler ModelNameHandler) Option

func WithOutPath

func WithOutPath(path string) Option

default: ./model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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