From 64a9b06e64cd09ffc0e599d802ee0c7897ba4e33 Mon Sep 17 00:00:00 2001 From: John Guo Date: Sun, 23 May 2021 00:02:49 +0800 Subject: [PATCH] comment update --- database/gdb/gdb_core.go | 1 + database/gredis/gredis.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/database/gdb/gdb_core.go b/database/gdb/gdb_core.go index 6aa55414c..a275ef2bd 100644 --- a/database/gdb/gdb_core.go +++ b/database/gdb/gdb_core.go @@ -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. diff --git a/database/gredis/gredis.go b/database/gredis/gredis.go index 744ba4da6..13211d81d 100644 --- a/database/gredis/gredis.go +++ b/database/gredis/gredis.go @@ -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()