playerdb

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 14 Imported by: 0

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) (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