feat:完善入驻信息管理
This commit is contained in:
@ -23,8 +23,11 @@ var (
|
||||
)
|
||||
|
||||
type Instance struct {
|
||||
debug bool
|
||||
dbMode string
|
||||
debug bool
|
||||
dbMode string
|
||||
tablePrefix string
|
||||
singularTable bool
|
||||
maxIdleConns, maxOpenConns, maxLifetime int
|
||||
*logic.Mysql
|
||||
*logic.Sqlite
|
||||
}
|
||||
@ -43,14 +46,46 @@ func WithDBMode(dbMode string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithMysqlUser(user string) Option {
|
||||
func WithTablePrefix(tablePrefix string) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.tablePrefix = tablePrefix
|
||||
}
|
||||
}
|
||||
|
||||
func WithSingularTable(singularTable bool) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.singularTable = singularTable
|
||||
}
|
||||
}
|
||||
|
||||
func WithMaxIdleConns(maxIdleConns int) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.maxIdleConns = maxIdleConns
|
||||
}
|
||||
}
|
||||
|
||||
func WithMaxOpenConns(maxOpenConns int) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.maxOpenConns = maxOpenConns
|
||||
}
|
||||
}
|
||||
|
||||
func WithMaxLifetime(maxLifetime int) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.maxLifetime = maxLifetime
|
||||
}
|
||||
}
|
||||
|
||||
func WithMysqlOption(user string) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.Mysql.User = user
|
||||
}
|
||||
}
|
||||
|
||||
func WithMysql() {
|
||||
|
||||
func WithSqliteOption(user string) Option {
|
||||
return func(instance *Instance) {
|
||||
instance.Mysql.User = user
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Instance) Init() {
|
||||
|
Reference in New Issue
Block a user