Documentation ¶
Index ¶
- Variables
- type Hooks
- type Piper
- type Source
- type SourceFactory
- type Target
- type TargetPool
- func (t *TargetPool) Acquire() (ctrl.Target, error)
- func (t *TargetPool) AcquireNew() (ctrl.Target, error)
- func (t *TargetPool) Close() error
- func (t *TargetPool) HijackOne() (*pgconn.HijackedConn, func(), error)
- func (t *TargetPool) Release(target *Target)
- func (t *TargetPool) Switch(new bool) error
- func (t *TargetPool) UseNew() bool
- type TargetReader
Constants ¶
This section is empty.
Variables ¶
View Source
var PiperFactory = &piperFactor{}
View Source
var TargetReplyer ctrl.TargetReplyer = &targetReplyer{}
Functions ¶
This section is empty.
Types ¶
type Piper ¶
type Piper struct {
// contains filtered or unexported fields
}
Piper implementaiton of ctrl.Piper
type SourceFactory ¶
type SourceFactory struct {
// contains filtered or unexported fields
}
func NewSourceFactory ¶
func NewSourceFactory(urls string, h *pgconn.HijackedConn) (*SourceFactory, error)
type TargetPool ¶
type TargetPool struct {
// contains filtered or unexported fields
}
func NewTargetPool ¶
func NewTargetPool(oldurl, newurl string, useNew bool) (*TargetPool, error)
func (*TargetPool) Acquire ¶
func (t *TargetPool) Acquire() (ctrl.Target, error)
fake implementation of acquire
func (*TargetPool) AcquireNew ¶
func (t *TargetPool) AcquireNew() (ctrl.Target, error)
fake implementation of acquire new
func (*TargetPool) Close ¶
func (t *TargetPool) Close() error
func (*TargetPool) HijackOne ¶
func (t *TargetPool) HijackOne() (*pgconn.HijackedConn, func(), error)
func (*TargetPool) Release ¶
func (t *TargetPool) Release(target *Target)
fake implementation of release
func (*TargetPool) Switch ¶
func (t *TargetPool) Switch(new bool) error
Switch will switch the connection from old connection to new connection If we still have old connection alive until timeout, it should return error
func (*TargetPool) UseNew ¶
func (t *TargetPool) UseNew() bool
UseNew should block if we in the switching progress
type TargetReader ¶
type TargetReader struct {
// contains filtered or unexported fields
}
TargetReader
func (*TargetReader) SetTarget ¶
func (tr *TargetReader) SetTarget(t ctrl.Target)
func (*TargetReader) StillChat ¶
func (tr *TargetReader) StillChat() bool
Click to show internal directories.
Click to hide internal directories.