Documentation
¶
Index ¶
- type Pool
- type Router
- func (r *Router) CleanUp()
- func (r *Router) Context() map[string]string
- func (r *Router) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, auth *idb.ReAuthToken, ...) (string, error)
- func (r *Router) GetOrUpdateReaders(ctx context.Context, bookmarks func(context.Context) ([]string, error), ...) ([]string, error)
- func (r *Router) GetOrUpdateWriters(ctx context.Context, bookmarks func(context.Context) ([]string, error), ...) ([]string, error)
- func (r *Router) Invalidate(database string)
- func (r *Router) InvalidateReader(db string, server string)
- func (r *Router) InvalidateServer(server string)
- func (r *Router) InvalidateWriter(db string, server string)
- func (r *Router) Readers(database string) []string
- func (r *Router) Writers(database string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool interface {
// Borrow acquires a connection from the provided list of servers
// If all connections are busy and the pool is full, calls to Borrow may wait for a connection to become idle
// If a connection has been idle for longer than idlenessTimeout, it will be reset
// to check if it's still alive.
Borrow(ctx context.Context, getServers func() []string, wait bool, boltLogger log.BoltLogger, idlenessTimeout time.Duration, auth *idb.ReAuthToken) (idb.Connection, error)
Return(ctx context.Context, c idb.Connection)
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is thread safe
func (*Router) GetNameOfDefaultDatabase ¶
func (*Router) GetOrUpdateReaders ¶
func (*Router) GetOrUpdateWriters ¶
func (*Router) Invalidate ¶
func (*Router) InvalidateReader ¶
func (*Router) InvalidateServer ¶
func (*Router) InvalidateWriter ¶
Click to show internal directories.
Click to hide internal directories.