router

package
v5.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 New

func New(rootRouter string, getRouters func() []string, routerContext map[string]string, pool Pool, idlenessTimeout time.Duration, logger log.Logger, logId string) *Router

func (*Router) CleanUp

func (r *Router) CleanUp()

func (*Router) Context

func (r *Router) Context() map[string]string

func (*Router) GetNameOfDefaultDatabase

func (r *Router) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, auth *idb.ReAuthToken, boltLogger log.BoltLogger) (string, error)

func (*Router) GetOrUpdateReaders added in v5.8.1

func (r *Router) GetOrUpdateReaders(ctx context.Context, bookmarks func(context.Context) ([]string, error), database string, auth *idb.ReAuthToken, boltLogger log.BoltLogger) ([]string, error)

func (*Router) GetOrUpdateWriters added in v5.8.1

func (r *Router) GetOrUpdateWriters(ctx context.Context, bookmarks func(context.Context) ([]string, error), database string, auth *idb.ReAuthToken, boltLogger log.BoltLogger) ([]string, error)

func (*Router) Invalidate

func (r *Router) Invalidate(database string)

func (*Router) InvalidateReader

func (r *Router) InvalidateReader(db string, server string)

func (*Router) InvalidateServer added in v5.12.0

func (r *Router) InvalidateServer(server string)

func (*Router) InvalidateWriter

func (r *Router) InvalidateWriter(db string, server string)

func (*Router) Readers

func (r *Router) Readers(database string) []string

func (*Router) Writers

func (r *Router) Writers(database string) []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL