db

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	DriverFor(tmsID token.TMSID) (drivers.DriverName, error)
}

type ConfigProvider

type ConfigProvider = driver.ConfigProvider

type DBDriver

type DBDriver[D any] interface {
	Open(cp ConfigProvider, tmsid token.TMSID) (D, error)
}

type DriverHolder

type DriverHolder[S any, D any, O DBDriver[D]] struct {
	*drivers.Holder[*dbOpener[S, D, O]]
	// contains filtered or unexported fields
}

func NewDriverHolder

func NewDriverHolder[S any, D any, O DBDriver[D]](newDB dbInstantiator[S, D, O], ds ...NamedDriver[O]) *DriverHolder[S, D, O]

func (*DriverHolder[S, D, O]) GetByTMSId

func (h *DriverHolder[S, D, O]) GetByTMSId(sp serviceProvider, tmsID token.TMSID) (S, error)

GetByTMSId returns the service for the given TMS id. Nil might be returned if the wallet is not found or an error occurred.

func (*DriverHolder[S, D, O]) GetProvider

func (h *DriverHolder[S, D, O]) GetProvider(sp serviceProvider) (*Manager[S, D, O], error)

func (*DriverHolder[S, D, O]) NewManager

func (h *DriverHolder[S, D, O]) NewManager(cp ConfigProvider, config Config) *Manager[S, D, O]

NewManager creates a new DB manager.

func (*DriverHolder[S, D, O]) Register

func (h *DriverHolder[S, D, O]) Register(name drivers.DriverName, driver O)

type Manager

type Manager[S any, D any, O DBDriver[D]] struct {
	// contains filtered or unexported fields
}

func (*Manager[S, D, O]) DBByTMSId

func (m *Manager[S, D, O]) DBByTMSId(id token.TMSID) (S, error)

DBByTMSId returns a service for the given TMS id

type NamedDriver

type NamedDriver[O any] driver3.NamedDriver[O]

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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