db

package
v1.13.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(database Database) error

Types

type Database

type Database interface {
	DB() *sql.DB
	Logger() *slog.Logger
	Close() error
}

func New

func New(logger *slog.Logger, opts DatabaseOpts) (Database, error)

type DatabaseOpts

type DatabaseOpts struct {
	URL   string
	Token string
}

type LocalDB added in v1.13.1

type LocalDB struct {
	// contains filtered or unexported fields
}

func (*LocalDB) Close added in v1.13.1

func (d *LocalDB) Close() error

func (*LocalDB) DB added in v1.13.1

func (d *LocalDB) DB() *sql.DB

func (*LocalDB) Logger added in v1.13.1

func (d *LocalDB) Logger() *slog.Logger

type RemoteDB added in v1.13.1

type RemoteDB struct {
	// contains filtered or unexported fields
}

func (*RemoteDB) Close added in v1.13.1

func (d *RemoteDB) Close() error

func (*RemoteDB) DB added in v1.13.1

func (d *RemoteDB) DB() *sql.DB

func (*RemoteDB) Logger added in v1.13.1

func (d *RemoteDB) Logger() *slog.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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