database

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GormKind = "gorm"
)

Variables

View Source
var OrmGeneratorRegistry = make(map[OrmKind]IOrmGenerator)

Functions

func RegisterOrmGenerator

func RegisterOrmGenerator(kind OrmKind, instance IOrmGenerator)

Types

type AbstractBaseGenerator

type AbstractBaseGenerator struct {
	Driver           string
	Dsn              string
	TablePrefix      string
	TableGlob        string
	TableExcludeGlob string
	GenGenGo         bool
	Dir              string

	CaseConverter       func(string) string
	ProtoGenerator      v3.ProtoGenerator
	Omitempty           bool
	AllowGetWithReqBody bool
	Client              bool
	Env                 string

	ConfigPackage string
	// contains filtered or unexported fields
}

func (*AbstractBaseGenerator) GenDao added in v2.3.1

func (b *AbstractBaseGenerator) GenDao()

func (*AbstractBaseGenerator) GenGrpc added in v2.5.2

func (b *AbstractBaseGenerator) GenGrpc()

func (*AbstractBaseGenerator) GenRest added in v2.5.2

func (b *AbstractBaseGenerator) GenRest()

func (*AbstractBaseGenerator) Initialize

func (b *AbstractBaseGenerator) Initialize(conf OrmGeneratorConfig)

type GormGenerator

type GormGenerator struct {
	*AbstractBaseGenerator
}

func (*GormGenerator) Initialize

func (gg *GormGenerator) Initialize(conf OrmGeneratorConfig)

type IOrmGenerator

type IOrmGenerator interface {
	Initialize(conf OrmGeneratorConfig)
	GenGrpc()
	GenRest()
	GenDao()
	// contains filtered or unexported methods
}

func GetOrmGenerator

func GetOrmGenerator(kind OrmKind) IOrmGenerator

type OrmGeneratorConfig

type OrmGeneratorConfig struct {
	Driver           string
	Dsn              string
	TablePrefix      string
	TableGlob        string
	TableExcludeGlob string
	GenGenGo         bool
	CaseConverter    func(string) string
	Dir              string
	Soft             string
	ProtoGenerator   v3.ProtoGenerator
	Omitempty        bool
	TypeMapping      string
}

type OrmKind

type OrmKind string

Jump to

Keyboard shortcuts

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