pdatadb

package
v0.0.0-...-8e88d4a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package pdatadb implements sqlite3 database storage for pdata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB stores player data in a sqlite3 database.

func Open

func Open(name string) (*DB, error)

Open opens a DB from the provided sqlite3 uri.

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetPdataCached

func (db *DB) GetPdataCached(uid uint64, sha [sha256.Size]byte) (buf []byte, exists bool, err error)

func (*DB) GetPdataHash

func (db *DB) GetPdataHash(uid uint64) (hash [sha256.Size]byte, exists bool, err error)

func (*DB) MigrateDown

func (db *DB) MigrateDown(ctx context.Context, to uint64) error

MigrateDown migrates the database down to the provided version. This will probably eat your data.

func (*DB) MigrateUp

func (db *DB) MigrateUp(ctx context.Context, to uint64) error

MigrateUp migrates the database to the provided version.

func (*DB) SetPdata

func (db *DB) SetPdata(uid uint64, buf []byte) (n int, err error)

func (*DB) Version

func (db *DB) Version() (current, required uint64, err error)

Version gets the current and required database versions. It should be checked before using the database.

Jump to

Keyboard shortcuts

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