drivers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverName

type DriverName = string

type Holder

type Holder[D any] struct {
	Logger logging.Logger

	Drivers map[DriverName]D
	// contains filtered or unexported fields
}

func NewHolder

func NewHolder[D any]() *Holder[D]

func (*Holder[D]) DriverNames

func (h *Holder[D]) DriverNames() []string

DriverNames returns a sorted list of the names of the registered drivers.

func (*Holder[D]) Get

func (h *Holder[D]) Get(name DriverName) (D, bool)

func (*Holder[D]) Register

func (h *Holder[D]) Register(name DriverName, driver D)

Register makes a driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics.

Jump to

Keyboard shortcuts

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