database 客户端里面有接口:

// Pinger is an optional interface that may be implemented by a [Conn].
//
// If a [Conn] does not implement Pinger, the [database/sql.DB.Ping] and
// [database/sql.DB.PingContext] will check if there is at least one [Conn] 
available.
//
// If Conn.Ping returns [ErrBadConn], [database/sql.DB.Ping] and 
[database/sql.DB.PingContext] will remove
// the [Conn] from pool.
type Pinger interface {
Ping(ctx context.Context) error

}




如何在iotdb-client-go里实现ping 方法




Reply via email to