driver

package
v0.0.0-...-d091464 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Migration returns a handle to the underlying store for use with migrations.
	Migration() (database.Driver, error)

	// LoadItemAttributes loads information about all item attributes.
	LoadItemAttributes() ([]*model.ItemAttributes, error)

	// SavePlayer saves data about a player.
	SavePlayer(p *model.Player) error

	// LoadPlayer loads data about a player with a username.
	LoadPlayer(username string) (*model.Player, error)

	// Close cleans up resources used by the driver.
	Close() error
}

Driver is an interface for a driver that interfaces with a backend database.

func NewSQLite3Driver

func NewSQLite3Driver(cfg *config.SQLite3DatabaseConfig) (Driver, error)

NewSQLite3Driver creates a new SQLite3 database driver.

type SQLite3Driver

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

SQLite3Driver is a driver that interfaces with a SQLite3 database.

func (*SQLite3Driver) Close

func (s *SQLite3Driver) Close() error

Close cleans up resources used by the SQLite3 driver.

func (*SQLite3Driver) LoadItemAttributes

func (s *SQLite3Driver) LoadItemAttributes() ([]*model.ItemAttributes, error)

LoadItemAttributes loads information about all item attributes from a SQLite3 database.

func (*SQLite3Driver) LoadPlayer

func (s *SQLite3Driver) LoadPlayer(username string) (*model.Player, error)

LoadPlayer loads information about a player from a SQLite3 database.

func (*SQLite3Driver) Migration

func (s *SQLite3Driver) Migration() (database.Driver, error)

Migration returns a handle to the underlying store for use with SQLite3 migrations.

func (*SQLite3Driver) SavePlayer

func (s *SQLite3Driver) SavePlayer(p *model.Player) error

SavePlayer updates a player's information in a SQLite3 database.

Jump to

Keyboard shortcuts

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