comment update

This commit is contained in:
John Guo
2021-05-23 00:02:49 +08:00
parent 6d81aa4462
commit 64a9b06e64
2 changed files with 5 additions and 4 deletions

View File

@ -48,6 +48,7 @@ func (c *Core) Ctx(ctx context.Context) DB {
)
*newCore = *c
newCore.ctx = ctx
// It creates a new DB object, which is commonly a wrapper for object `Core`.
newCore.db, err = driverMap[configNode.Type].New(newCore, configNode)
if err != nil {
// It is really a serious error here.

View File

@ -32,14 +32,14 @@ type Redis struct {
ctx context.Context // Context.
}
// Redis connection.
// Conn is redis connection.
type Conn struct {
redis.Conn
ctx context.Context
redis *Redis
}
// Redis configuration.
// Config is redis configuration.
type Config struct {
Host string `json:"host"`
Port int `json:"port"`
@ -54,7 +54,7 @@ type Config struct {
TLSSkipVerify bool `json:"tlsSkipVerify"` // Disables server name verification when connecting over TLS.
}
// Pool statistics.
// PoolStats is statistics of redis connection pool.
type PoolStats struct {
redis.PoolStats
}
@ -189,7 +189,7 @@ func (r *Redis) Conn() *Conn {
}
}
// Alias of Conn, see Conn.
// GetConn is alias of Conn, see Conn.
// Deprecated, use Conn instead.
func (r *Redis) GetConn() *Conn {
return r.Conn()