drivers

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownDriver = errors.New("unknown driver")

Functions

func New

func New(ctx context.Context, cfg *Config) (leaderElect bool, backend server.Backend, err error)

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

func GetDefault

func GetDefault() Constructor

GetDefault returns the default driver

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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