memory

package
v0.0.0-...-c891680 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memory implements a data store in memory only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Database is the in memory implementation of the database store.

func NewDatabase

func NewDatabase() (*Database, error)

NewDatabase creates an empty memory based database.

func (*Database) CreateUser

func (db *Database) CreateUser(_ context.Context, user models.User) (err error)

func (*Database) GetData

func (db *Database) GetData() models.Data

func (*Database) GetUserByID

func (db *Database) GetUserByID(_ context.Context, id uint64) (user models.User, err error)

func (*Database) SetData

func (db *Database) SetData(data models.Data)

func (*Database) Start

func (db *Database) Start(_ context.Context) (runError <-chan error, err error)

func (*Database) Stop

func (db *Database) Stop() (err error)

func (*Database) String

func (db *Database) String() string

Jump to

Keyboard shortcuts

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