Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI MongoDB 交互式命令行客户端
func NewCLIWithConfig ¶
NewCLIWithConfig 使用配置创建 MongoDB CLI 实例
type Config ¶
type Config struct {
Host string
Port int
Username string
Password string
Database string
AuthSource string // 认证数据库,默认 admin
ReplicaSet string // 副本集名称
ConnectTimeout time.Duration // 连接超时,默认 10s
ServerSelectionTimeout time.Duration // 服务器选择超时,默认 10s
SocketTimeout time.Duration // Socket 超时,默认 30s
MaxPoolSize int // 最大连接池大小,默认 100
MinPoolSize int // 最小连接池大小,默认 0
MaxConnIdleTime time.Duration // 最大连接空闲时间,默认 0
RetryWrites bool // 是否重试写入,默认 true
RetryReads bool // 是否重试读取,默认 true
Direct bool // 是否直接连接,默认 false
TLS bool // 是否启用 TLS,默认 false
CustomParams string // 自定义参数,如 "param1=value1¶m2=value2"
}
Config MongoDB 连接配置
type ReadWriteCloser ¶ added in v0.1.1
type ReadWriteCloser struct {
io.ReadWriter
}
ReadWriteCloser wraps io.ReadWriter to add a no-op Close method
func (*ReadWriteCloser) Close ¶ added in v0.1.1
func (rwc *ReadWriteCloser) Close() error
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader 从终端读取输入(使用 readline 以支持SSH session)
Click to show internal directories.
Click to hide internal directories.