Versions in this module Expand all Collapse all v2 v2.0.0 May 30, 2022 Changes in this version + var Default = New() + var DefaultOpts = Options + var ErrProxyAllreadySettedUniversalClient = errors.New("代理不能重复设置客户端对象") + var ErrProxyNotYetSettedUniversalClient = errors.New("代理还未设置客户端对象") + var ErrUnSupportSchema = errors.New("未支持的数据库管理服务类型") + var ErrUnknownClientType = errors.New("未知的redis客户端类型") + var Logger *log.Log + func NewDB(URL string, dopts *Options) (*bun.DB, error) + func SetPool(sqldb *sql.DB, opts *Options) + func WithConnMaxIdleTimeMS(ConnMaxIdleTimeMS int) optparams.Option[Options] + func WithConnMaxLifetimeMS(ConnMaxLifetimeMS int) optparams.Option[Options] + func WithDiscardUnknownColumns() optparams.Option[Options] + func WithMaxIdleConns(MaxIdleConns int) optparams.Option[Options] + func WithMaxOpenConns(MaxOpenConns int) optparams.Option[Options] + func WithParallelCallback() optparams.Option[Options] + func WithQueryTimeoutMS(QueryTimeout int) optparams.Option[Options] + type Callback func(cli *bun.DB) error + type Options struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + DiscardUnknownColumns bool + MaxIdleConns int + MaxOpenConns int + Parallelcallback bool + QueryTimeout time.Duration + type Proxy struct + Opt Options + func New() *Proxy + func (proxy *Proxy) Init(URL string, opts ...optparams.Option[Options]) error + func (proxy *Proxy) IsOk() bool + func (proxy *Proxy) NewCtx() (ctx context.Context, cancel context.CancelFunc) + func (proxy *Proxy) Regist(cb Callback) error + func (proxy *Proxy) SetConnect(cli *bun.DB) error