Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRow = sql.ErrNoRows ErrRecordNotFound = gorm.ErrRecordNotFound ErrCantStartTransaction = gorm.ErrCantStartTransaction ErrInvalidSQL = gorm.ErrInvalidSQL ErrInvalidTransaction = gorm.ErrInvalidTransaction ErrUnaddressable = gorm.ErrUnaddressable )
Functions ¶
func InitGorm ¶
func InitGorm(c *MySQLConfig) (db *gorm.DB)
func InitXorm ¶
func InitXorm(c *MySQLConfig) (db *xorm.Engine)
Types ¶
type MySQLConfig ¶
type MySQLConfig struct { DSN string // data source name. Active int // pool Idle int // pool IdleTimeout int // connect max life time. second ShowSQL bool }
MySQLConfig mysql config.
type Redis ¶
type Redis struct {
Redis *redis.Client
}
func InitRedis ¶
func InitRedis(c *RedisConfig) (r *Redis)
type RedisCluster ¶
type RedisCluster struct {
Redis *redis.ClusterClient
}
func InitRedisCluster ¶
func InitRedisCluster(c *RedisConfig) (rc *RedisCluster)
func (*RedisCluster) Transaction ¶
func (r *RedisCluster) Transaction(ctx context.Context, fc func(tx redis.Pipeliner) error) error
type RedisConfig ¶
redis redis config.
Click to show internal directories.
Click to hide internal directories.