drivers

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func New

func New(ctx context.Context, wg *sync.WaitGroup, 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
	CompactInterval       time.Duration
	CompactIntervalJitter int
	CompactTimeout        time.Duration
	CompactMinRetain      int64
	CompactBatchSize      int64
	PollBatchSize         int64
}

type Constructor

type Constructor func(ctx context.Context, wg *sync.WaitGroup, cfg *Config) (leaderElect bool, backend server.Backend, err error)

Constructor is a function that takes a context, waitgroup, and 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