dao

package
v0.0.0-...-c902e56 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBClient

func GetDBClient() *daoongorm.DBClient

db client

Types

type CacheUtilDemo

type CacheUtilDemo struct {
	*redisutil.RedisUtil
}

func GetCacheUtil

func GetCacheUtil() *CacheUtilDemo

缓存组件

func NewCacheUtilDemo

func NewCacheUtilDemo(redisConfig *RedisConfig) *CacheUtilDemo

type CclehuiTestADao

type CclehuiTestADao struct {
	ID        int       `gorm:"column:id;primaryKey" structs:"id" json:"id"`
	Version   int64     `gorm:"column:version" structs:"version" json:"version"`
	Weight    float64   `gorm:"column:weight;column_default:1.9" structs:"weight" json:"weight"`
	Age       time.Time `gorm:"column:age" structs:"age" json:"age"`
	Extra     string    `gorm:"column:extra" structs:"extra" json:"extra"`
	CreatedAt time.Time `gorm:"column:created_at" structs:"created_at" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at" structs:"updated_at" json:"updated_at"`
	// contains filtered or unexported fields
}

func NewCclehuiTestADao

func NewCclehuiTestADao(ctx context.Context, myDao *CclehuiTestADao, readOnly bool, options ...daoongorm.Option) (*CclehuiTestADao, error)

func NewCclehuiTestADaoWithTX

func NewCclehuiTestADaoWithTX(ctx context.Context,
	myDao *CclehuiTestADao, tx *daoongorm.DBClient, options ...daoongorm.Option) (*CclehuiTestADao, error)

支持事务

func (*CclehuiTestADao) DBClient

func (myDao *CclehuiTestADao) DBClient() daoongorm.DBClientInterface

func (*CclehuiTestADao) DBName

func (myDao *CclehuiTestADao) DBName() string

func (*CclehuiTestADao) GetDaoBase

func (myDao *CclehuiTestADao) GetDaoBase() *daoongorm.DaoBase

func (*CclehuiTestADao) SetDaoBase

func (myDao *CclehuiTestADao) SetDaoBase(myDaoBase *daoongorm.DaoBase)

func (*CclehuiTestADao) TableName

func (myDao *CclehuiTestADao) TableName() string

type CclehuiTestASelector

type CclehuiTestASelector struct{}

直接从库中查数据

func (*CclehuiTestASelector) GetDataByID

func (selector *CclehuiTestASelector) GetDataByID(ctx context.Context, dataID int) (
	*CclehuiTestADao, error)

func (*CclehuiTestASelector) GetDataCountByID

func (selector *CclehuiTestASelector) GetDataCountByID(ctx context.Context, dataID int) (int64, error)

type CclehuiTestBDao

type CclehuiTestBDao struct {
	ColumnID     int       `gorm:"column:column_id;primaryKey" structs:"column_id" json:"column_id"`
	Version      int64     `gorm:"column:version" structs:"version" json:"version"`
	Weight       float64   `gorm:"column:weight;column_default:1.9" structs:"weight" json:"weight"`
	Age          time.Time `gorm:"column:age" structs:"age" json:"age"`
	Extra        string    `gorm:"column:extra" structs:"extra" json:"extra"`
	CreatedAtNew time.Time `gorm:"column:created_at_new" structs:"created_at_new" json:"created_at_new"`
	UpdatedAtNew time.Time `gorm:"column:updated_at_new" structs:"updated_at_new" json:"updated_at_new"`
	// contains filtered or unexported fields
}

func NewCclehuiTestBDao

func NewCclehuiTestBDao(ctx context.Context, myDao *CclehuiTestBDao, readOnly bool, options ...daoongorm.Option) (*CclehuiTestBDao, error)

func NewCclehuiTestBDaoWithTX

func NewCclehuiTestBDaoWithTX(ctx context.Context,
	myDao *CclehuiTestBDao, tx *daoongorm.DBClient, options ...daoongorm.Option) (*CclehuiTestBDao, error)

支持事务

func (*CclehuiTestBDao) DBClient

func (myDao *CclehuiTestBDao) DBClient() daoongorm.DBClientInterface

func (*CclehuiTestBDao) DBName

func (myDao *CclehuiTestBDao) DBName() string

func (*CclehuiTestBDao) GetDaoBase

func (myDao *CclehuiTestBDao) GetDaoBase() *daoongorm.DaoBase

func (*CclehuiTestBDao) SetDaoBase

func (myDao *CclehuiTestBDao) SetDaoBase(myDaoBase *daoongorm.DaoBase)

func (*CclehuiTestBDao) TableName

func (myDao *CclehuiTestBDao) TableName() string

type CclehuiTestCDao

type CclehuiTestCDao struct {
	ColumnID  int       `gorm:"column:column_id;primaryKey" structs:"column_id" json:"column_id"`
	Version   int64     `gorm:"column:version" structs:"version" json:"version"`
	Weight    float64   `gorm:"column:weight;column_default:1.9" structs:"weight" json:"weight"`
	Age       time.Time `gorm:"column:age" structs:"age" json:"age"`
	Extra     string    `gorm:"column:extra" structs:"extra" json:"extra"`
	CreatedAt time.Time `gorm:"column:created_at" structs:"created_at" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at" structs:"updated_at" json:"updated_at"`
	// contains filtered or unexported fields
}

非自增主键

func NewCclehuiTestCDao

func NewCclehuiTestCDao(ctx context.Context, myDao *CclehuiTestCDao, readOnly bool, options ...daoongorm.Option) (*CclehuiTestCDao, error)

func NewCclehuiTestCDaoWithTX

func NewCclehuiTestCDaoWithTX(ctx context.Context,
	myDao *CclehuiTestCDao, tx *daoongorm.DBClient, options ...daoongorm.Option) (*CclehuiTestCDao, error)

支持事务

func (*CclehuiTestCDao) DBClient

func (myDao *CclehuiTestCDao) DBClient() daoongorm.DBClientInterface

func (*CclehuiTestCDao) DBName

func (myDao *CclehuiTestCDao) DBName() string

func (*CclehuiTestCDao) GetDaoBase

func (myDao *CclehuiTestCDao) GetDaoBase() *daoongorm.DaoBase

func (*CclehuiTestCDao) SetDaoBase

func (myDao *CclehuiTestCDao) SetDaoBase(myDaoBase *daoongorm.DaoBase)

func (*CclehuiTestCDao) TableName

func (myDao *CclehuiTestCDao) TableName() string

type CclehuiTestDDao

type CclehuiTestDDao struct {
	UserID    int       `gorm:"column:user_id;primaryKey" structs:"user_id" json:"user_id"`
	ColumnID  int       `gorm:"column:column_id;primaryKey" structs:"column_id" json:"column_id"`
	Version   int64     `gorm:"column:version" structs:"version" json:"version"`
	Weight    float64   `gorm:"column:weight;column_default:1.9" structs:"weight" json:"weight"`
	Age       time.Time `gorm:"column:age" structs:"age" json:"age"`
	Extra     string    `gorm:"column:extra" structs:"extra" json:"extra"`
	CreatedAt time.Time `gorm:"column:created_at" structs:"created_at" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at" structs:"updated_at" json:"updated_at"`
	// contains filtered or unexported fields
}

联合主键

func NewCclehuiTestDDao

func NewCclehuiTestDDao(ctx context.Context, myDao *CclehuiTestDDao, readOnly bool, options ...daoongorm.Option) (*CclehuiTestDDao, error)

func NewCclehuiTestDDaoWithTX

func NewCclehuiTestDDaoWithTX(ctx context.Context,
	myDao *CclehuiTestDDao, tx *daoongorm.DBClient, options ...daoongorm.Option) (*CclehuiTestDDao, error)

支持事务

func (*CclehuiTestDDao) DBClient

func (myDao *CclehuiTestDDao) DBClient() daoongorm.DBClientInterface

func (*CclehuiTestDDao) DBName

func (myDao *CclehuiTestDDao) DBName() string

func (*CclehuiTestDDao) GetDaoBase

func (myDao *CclehuiTestDDao) GetDaoBase() *daoongorm.DaoBase

func (*CclehuiTestDDao) SetDaoBase

func (myDao *CclehuiTestDDao) SetDaoBase(myDaoBase *daoongorm.DaoBase)

func (*CclehuiTestDDao) TableName

func (myDao *CclehuiTestDDao) TableName() string

type ConfigDemo

type ConfigDemo struct {
	Mysql *Mysql `yaml:"mysql"`
	Redis *Redis `yaml:"redis"`
}

func (*ConfigDemo) DecodeFromFile

func (c *ConfigDemo) DecodeFromFile(filePath string) (*ConfigDemo, error)

type Mysql

type Mysql struct {
	Test *daoongorm.DBClientConfig `yaml:"test"`
}

type Redis

type Redis struct {
	Default *RedisConfig `yaml:"default"`
}

type RedisConfig

type RedisConfig struct {
	Server   string `yaml:"server"`   // "xxxxx:6379"
	Password string `yaml:"password"` // "wxxxxxxx"
}

Jump to

Keyboard shortcuts

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