playerdb

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider is a player data provider that uses a LevelDB database to store data. The data passed on will first be converted to make sure it can be marshaled into JSON. This JSON (in bytes) will then be stored in the database under a key that is the byte representation of the player's UUID.

func NewProvider

func NewProvider(path string) (*Provider, error)

NewProvider creates a new player data provider that saves and loads data using a LevelDB database.

func (*Provider) Close

func (p *Provider) Close() error

Close ...

func (*Provider) Load

func (p *Provider) Load(id uuid.UUID, world func(world.Dimension) *world.World) (player.Data, error)

Load ...

func (*Provider) Save

func (p *Provider) Save(id uuid.UUID, d player.Data) error

Save ...

Jump to

Keyboard shortcuts

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