dao_convertor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KCreate = iota
	KQuery
	KUpdate
	KDelete
	CRUDLen
)

CRUD internal flag

Variables

This section is empty.

Functions

func ParseTag

func ParseTag(tag string) (tagNums *[CRUDLen]TagInfo, err error)

func ParseTagHandler

func ParseTagHandler(structName, fieldName, tag string)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(username, password, host string, port int, database string) *Config

func (*Config) Dsn

func (Output *Config) Dsn(t string) *Config

func (*Config) EnableCreate

func (Output *Config) EnableCreate(t bool) *Config

func (*Config) EnableDebug

func (Output *Config) EnableDebug(t bool) *Config

func (*Config) EnableDelete

func (Output *Config) EnableDelete(t bool) *Config

func (*Config) EnableOr

func (Output *Config) EnableOr(t bool) *Config

func (*Config) EnableQuery

func (Output *Config) EnableQuery(t bool) *Config

func (*Config) EnableUpdate

func (Output *Config) EnableUpdate(t bool) *Config

func (*Config) OrmPackageName

func (Output *Config) OrmPackageName(t string) *Config

func (*Config) PackageName

func (Output *Config) PackageName(t string) *Config

func (*Config) SavePath

func (Output *Config) SavePath(t string) *Config

func (*Config) SqlPackageName

func (Output *Config) SqlPackageName(t string) *Config

type Struct2DAO

type Struct2DAO struct {
	// contains filtered or unexported fields
}

func NewStruct2DAO

func NewStruct2DAO(config *Config) *Struct2DAO

func (*Struct2DAO) AutoMigrate

func (s *Struct2DAO) AutoMigrate(t ...interface{}) *Struct2DAO

func (*Struct2DAO) Config

func (s *Struct2DAO) Config(config Config) *Struct2DAO

func (*Struct2DAO) Error

func (s *Struct2DAO) Error() error

func (*Struct2DAO) Run

func (s *Struct2DAO) Run() error

type TagInfo

type TagInfo struct {
	Action int
	Where  string
	Omit   bool
	// contains filtered or unexported fields
}

func (*TagInfo) ParseString

func (t *TagInfo) ParseString(info string) error

type TagInfoMap

type TagInfoMap map[string]*[CRUDLen]TagInfo

func GetTagInfoMap

func GetTagInfoMap() *TagInfoMap

func (*TagInfoMap) GetTag

func (t *TagInfoMap) GetTag(structName, fieldName string) *[CRUDLen]TagInfo

func (*TagInfoMap) InsertTag

func (t *TagInfoMap) InsertTag(structName, fieldName string, tag TagInfo)

Jump to

Keyboard shortcuts

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