Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownDriver = errors.New("unknown driver")
Functions ¶
func Register ¶
func Register(scheme string, constructor Constructor)
Register registers a constructor for the given scheme
func SetDefault ¶
func SetDefault(scheme string)
SetDefault sets the default driver scheme The default driver is used when an endpoint is not specified
Types ¶
type Config ¶
type Config struct { MetricsRegisterer prometheus.Registerer Endpoint string Scheme string DataSourceName string ConnectionPoolConfig generic.ConnectionPoolConfig BackendTLSConfig tls.Config }
type Constructor ¶
type Constructor func(ctx context.Context, cfg *Config) (leaderElect bool, backend server.Backend, err error)
Constructor is a function that takes a context and a config and returns a leaderElect bool, a server.Backend and an error
func Get ¶
func Get(scheme string) (Constructor, bool)
Get returns the constructor for the given scheme The second return value is true if the scheme is registered, false otherwise
Click to show internal directories.
Click to hide internal directories.