database

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 21 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
	Dir         string

	Jsonattrcase        string
	Omitempty           bool
	AllowGetWithReqBody bool
	Client              bool
	Grpc                bool
	Env                 string
	// contains filtered or unexported fields
}

func (*AbstractBaseGenerator) GenService

func (b *AbstractBaseGenerator) GenService()

func (*AbstractBaseGenerator) Initialize

func (b *AbstractBaseGenerator) Initialize(conf OrmGeneratorConfig)

func (*AbstractBaseGenerator) ProtoFieldNamingFn

func (b *AbstractBaseGenerator) ProtoFieldNamingFn() func(string) string

type GormGenerator

type GormGenerator struct {
	*AbstractBaseGenerator
}

func (*GormGenerator) Initialize

func (gg *GormGenerator) Initialize(conf OrmGeneratorConfig)

func (*GormGenerator) ProtoFieldNamingFn

func (gg *GormGenerator) ProtoFieldNamingFn() func(string) string

type IOrmGenerator

type IOrmGenerator interface {
	Initialize(conf OrmGeneratorConfig)
	GenService()
	ProtoFieldNamingFn() func(string) string
	// contains filtered or unexported methods
}

func GetOrmGenerator

func GetOrmGenerator(kind OrmKind) IOrmGenerator

type OrmGeneratorConfig

type OrmGeneratorConfig struct {
	Driver      string
	Dsn         string
	TablePrefix string
	Dir         string
	Soft        string
	Grpc        bool
}

type OrmKind

type OrmKind string

Jump to

Keyboard shortcuts

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