Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAvailableClients = errors.New("no available clients") ErrNoAvailableServers = errors.New("no servers available for connection") )
Functions ¶
This section is empty.
Types ¶
type ClientsPool ¶
type ClientsPool interface { NextLive() (*NodeClient, error) NextDead() (*NodeClient, error) OnFailure(c *NodeClient) OnSuccess(c *NodeClient) }
func NewClientsPool ¶
func NewClientsPool(servers []string, insecure bool) (pool ClientsPool, err error)
type ClusterPool ¶
type ClusterPool struct {
// contains filtered or unexported fields
}
func (*ClusterPool) NextDead ¶
func (p *ClusterPool) NextDead() (*NodeClient, error)
func (*ClusterPool) NextLive ¶
func (p *ClusterPool) NextLive() (*NodeClient, error)
func (*ClusterPool) OnFailure ¶
func (p *ClusterPool) OnFailure(c *NodeClient)
func (*ClusterPool) OnSuccess ¶
func (p *ClusterPool) OnSuccess(c *NodeClient)
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
func NewNodeClient ¶
func NewNodeClient(dsn string, transport http.RoundTripper) (*NodeClient, error)
NewNodeClient create log hole node client.
func (*NodeClient) ActiveRequests ¶
func (c *NodeClient) ActiveRequests() int
ActiveRequests returns all active request of node client.
func (*NodeClient) LastUseTime ¶
func (c *NodeClient) LastUseTime() int
LastUseTime returns time of last started request.
func (*NodeClient) PingRequest ¶
func (c *NodeClient) PingRequest(timeout time.Duration) (code int, err error)
Ping request allows to check connection status.
func (*NodeClient) SendRequest ¶
type NodeConfig ¶
type SinglePool ¶
type SinglePool struct {
// contains filtered or unexported fields
}
func (*SinglePool) NextDead ¶
func (p *SinglePool) NextDead() (*NodeClient, error)
func (*SinglePool) NextLive ¶
func (p *SinglePool) NextLive() (*NodeClient, error)
func (*SinglePool) OnFailure ¶
func (p *SinglePool) OnFailure(c *NodeClient)
func (*SinglePool) OnSuccess ¶
func (p *SinglePool) OnSuccess(c *NodeClient)
Click to show internal directories.
Click to hide internal directories.