Documentation
¶
Index ¶
- func NewConfigDbClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
- func NewConfigMongoDbClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
- func NewConfigMysqlClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
- func NewConfigRedisClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
- func NewDbClientFromUri(ctx context.Context, name string, uri string) (gira.DbClient, error)
- type MigrateConnectTimeout
- type MigrateDropIndex
- type MigrateOption
- type MigrateOptions
- type MongoDbClient
- type MysqlClient
- type RedisClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigDbClient ¶
func NewConfigDbClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
根据配置构造db client
func NewConfigMongoDbClient ¶
func NewConfigMongoDbClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
根据配置构造mongodb client
func NewConfigMysqlClient ¶
func NewConfigMysqlClient(ctx context.Context, name string, config gira.DbConfig) (gira.DbClient, error)
根据配置构造mysql client
Types ¶
type MigrateConnectTimeout ¶
type MigrateConnectTimeout struct {
// contains filtered or unexported fields
}
func WithMigrateConnectTimeout ¶
func WithMigrateConnectTimeout(timeout int64) MigrateConnectTimeout
设置连接超时时间
func (MigrateConnectTimeout) ConfigMigrateOptions ¶
func (opt MigrateConnectTimeout) ConfigMigrateOptions(opts *MigrateOptions)
type MigrateDropIndex ¶
type MigrateDropIndex struct {
// contains filtered or unexported fields
}
func (MigrateDropIndex) ConfigMigrateOptions ¶
func (opt MigrateDropIndex) ConfigMigrateOptions(opts *MigrateOptions)
type MigrateOption ¶
type MigrateOption interface {
ConfigMigrateOptions(opts *MigrateOptions)
}
type MigrateOptions ¶
========= migrate选项 ==================
type MongoDbClient ¶
type MongoDbClient struct {
// contains filtered or unexported fields
}
mongodb客户端
func (*MongoDbClient) GetMongoClient ¶
func (self *MongoDbClient) GetMongoClient() *mongo.Client
func (*MongoDbClient) GetMongoDatabase ¶
func (self *MongoDbClient) GetMongoDatabase() *mongo.Database
func (*MongoDbClient) Uri ¶
func (self *MongoDbClient) Uri() string
type MysqlClient ¶
type MysqlClient struct {
// contains filtered or unexported fields
}
mysql客户端
func (*MysqlClient) GetMysqlClient ¶
func (self *MysqlClient) GetMysqlClient() *sql.DB
func (*MysqlClient) Uri ¶
func (self *MysqlClient) Uri() string
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
redis客户端
func (*RedisClient) GetRedisClient ¶
func (self *RedisClient) GetRedisClient() *redis.Client
func (*RedisClient) Uri ¶
func (self *RedisClient) Uri() string
Click to show internal directories.
Click to hide internal directories.