providerregistry

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package providerregistry maps database driver names to provider factories.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedDriver = errors.New("providerregistry: unsupported driver")

ErrUnsupportedDriver is returned when no factory is registered for a driver.

Functions

func IsRegistered

func IsRegistered(driver string) bool

IsRegistered reports whether driver has a registered factory.

func KnownDrivers

func KnownDrivers() []string

KnownDrivers returns registered names in deterministic order.

func New

func New(driver, dsn string, timeout time.Duration) (provider.Provider, error)

New opens the provider registered under driver.

func Register

func Register(name string, factory Factory)

Register adds a named provider factory. It panics for invalid or duplicate registrations so built-in driver mistakes fail during process startup.

Types

type Factory

type Factory func(dsn string, timeout time.Duration) (provider.Provider, error)

Factory opens a database provider.

Jump to

Keyboard shortcuts

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