Versions in this module Expand all Collapse all v0 v0.0.1 Nov 15, 2023 Changes in this version + const MONGODB_NAME + const MYSQL_NAME + const REDIS_NAME + func NewConfigDbClient(ctx context.Context, name string, config Config) (gen_server.DbClient, error) + func NewConfigMongoDbClient(ctx context.Context, name string, config Config) (gen_server.DbClient, error) + func NewConfigMysqlClient(ctx context.Context, name string, config Config) (gen_server.DbClient, error) + func NewConfigRedisClient(ctx context.Context, name string, config Config) (gen_server.DbClient, error) + func NewDbClientFromUri(ctx context.Context, name string, uri string) (gen_server.DbClient, error) + type Config struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + ConnnectTimeout time.Duration + Db string + Driver string + Host string + MaxIdleConns int + MaxOpenConns int + Password string + Port int + Query string + User string + func (self *Config) Parse(uri string) error + func (self Config) GormUri() string + func (self Config) Uri() string + type MigrateConnectTimeout struct + func WithMigrateConnectTimeout(timeout int64) MigrateConnectTimeout + func (opt MigrateConnectTimeout) ConfigMigrateOptions(opts *MigrateOptions) + type MigrateDropIndex struct + func WithMigrateDropIndex(enabled bool) MigrateDropIndex + func (opt MigrateDropIndex) ConfigMigrateOptions(opts *MigrateOptions) + type MigrateOption interface + ConfigMigrateOptions func(opts *MigrateOptions) + type MigrateOptions struct + ConnectTimeout int64 + EnabledDropIndex bool + type MongoDbClient struct + func (self *MongoDbClient) GetMongoClient() *mongo.Client + func (self *MongoDbClient) GetMongoDatabase() *mongo.Database + func (self *MongoDbClient) Uri() string + type MysqlClient struct + func (self *MysqlClient) GetMysqlClient() *sql.DB + func (self *MysqlClient) Uri() string + type RedisClient struct + func (self *RedisClient) GetRedisClient() *redis.Client + func (self *RedisClient) Uri() string