Documentation ¶
Index ¶
- Variables
- type Client
- type Connection
- func (c *Connection) Activate() error
- func (c *Connection) Call(serviceMethod string, args interface{}, reply interface{}) error
- func (c *Connection) Close() error
- func (c *Connection) DidFail() bool
- func (c *Connection) IsHealthy() bool
- func (c *Connection) MarkFailed()
- func (c *Connection) Reset()
- type ConnectionManager
- type RetryableError
- type ServerConfig
- type ServerSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientFailedToConnect = &RetryableError{errors.New("failed to get connection")}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Connection ¶
type Connection struct { sync.Mutex ServerConfig ServerConfig // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(server ServerConfig) *Connection
func (*Connection) Activate ¶
func (c *Connection) Activate() error
func (*Connection) Call ¶
func (c *Connection) Call(serviceMethod string, args interface{}, reply interface{}) error
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) DidFail ¶
func (c *Connection) DidFail() bool
func (*Connection) IsHealthy ¶
func (c *Connection) IsHealthy() bool
func (*Connection) MarkFailed ¶
func (c *Connection) MarkFailed()
func (*Connection) Reset ¶
func (c *Connection) Reset()
type ConnectionManager ¶
func NewConnectionManager ¶
func NewConnectionManager(servers *ServerSet, size int) *ConnectionManager
func (*ConnectionManager) Get ¶
func (m *ConnectionManager) Get(timeout time.Duration) *Connection
func (*ConnectionManager) Init ¶
func (m *ConnectionManager) Init()
func (*ConnectionManager) Pooled ¶
func (m *ConnectionManager) Pooled() []string
func (*ConnectionManager) Put ¶
func (m *ConnectionManager) Put(conn *Connection)
func (*ConnectionManager) Stats ¶
func (m *ConnectionManager) Stats() map[string]int
type RetryableError ¶
type RetryableError struct {
Err error
}
func (*RetryableError) Error ¶
func (re *RetryableError) Error() string
type ServerConfig ¶
func (ServerConfig) String ¶
func (s ServerConfig) String() string
type ServerSet ¶
func NewServerSet ¶
func NewServerSet(servers []ServerConfig, quarantinePeriod time.Duration) *ServerSet
func (*ServerSet) All ¶
func (s *ServerSet) All() []ServerConfig
func (*ServerSet) Quarantine ¶
func (s *ServerSet) Quarantine(server ServerConfig)
Click to show internal directories.
Click to hide internal directories.